Update web-platform-tests to revision ade06500869396f7a46b95bc3553af4ca9c07f31

This commit is contained in:
WPT Sync Bot 2018-10-17 21:30:21 -04:00
parent 9a0404ac5f
commit ed390a659c
51 changed files with 531 additions and 1075 deletions

View file

@ -25,7 +25,7 @@
</style>
</head>
<body>
<p>Test passes if there is a wide and thin horizontal black line and <strong>no red</strong></p>
<p>Test passes if there is a wide and thin horizontal black line and <strong>no red</strong>.</p>
<div id="wrapper">
<div id="test"></div>
</div>

View file

@ -22,7 +22,7 @@
<body>
<p>Test passes if there is a green stripe and <strong>no red</strong></p>
<p>Test passes if there is a green stripe and <strong>no red</strong>.</p>
<p><a>&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</a></p>

View file

@ -22,7 +22,7 @@
<body>
<p>Test passes if there is a green bar across the page and <strong>no red</strong></p>
<p>Test passes if there is a green bar across the page and <strong>no red</strong>.</p>
<form action="">
<p>&nbsp;</p>

View file

@ -29,7 +29,7 @@
<body>
<p>Test passes if there is a green square and <strong>no red</strong></p>
<p>Test passes if there is a green square and <strong>no red</strong>.</p>
<form action="">
<p><input></input></p>

View file

@ -29,7 +29,7 @@
<body>
<p>Test passes if there is a green square and <strong>no red</strong></p>
<p>Test passes if there is a green square and <strong>no red</strong>.</p>
<form action="">
<p><button>&nbsp;</button></p>

View file

@ -0,0 +1,18 @@
<!doctype html>
<title>CSS Conditional Test: @supports selector() with pseudo-elements.</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="author" href="https://mozilla.org" title="Mozilla">
<link rel="help" href="https://drafts.csswg.org/css-conditional/#at-supports">
<link rel="match" href="at-supports-001-ref.html">
<style>
div {
background-color:red;
height:100px;
width:100px;
}
@supports selector(::before) {
div { background: green };
}
</style>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div></div>

View file

@ -0,0 +1,18 @@
<!doctype html>
<title>CSS Conditional Test: @supports selector() with -webkit- unknown pseudo-elements and negation.</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="author" href="https://mozilla.org" title="Mozilla">
<link rel="help" href="https://drafts.csswg.org/css-conditional/#at-supports">
<link rel="match" href="at-supports-001-ref.html">
<style>
div {
background-color:red;
height:100px;
width:100px;
}
@supports not selector(::-webkit-unknown-pseudo) {
div { background: green };
}
</style>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div></div>

View file

@ -0,0 +1,18 @@
<!doctype html>
<title>CSS Conditional Test: @supports selector() with multiple selectors doesn't work.</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="author" href="https://mozilla.org" title="Mozilla">
<link rel="help" href="https://drafts.csswg.org/css-conditional/#at-supports">
<link rel="match" href="at-supports-001-ref.html">
<style>
div {
background-color: green;
height: 100px;
width: 100px;
}
@supports selector(div, div) {
div { background: red };
}
</style>
<p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
<div></div>

View file

@ -0,0 +1,41 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>Reference: display:none on OPTION and OPTGROUP</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<style>
.none { display:none; }
.contents { display:contents; }
.red { color: red; }
.green { color: green; }
select { -webkit-appearance: none; }
</style>
</head>
<body>
<pre>FAIL if there is any red color</pre>
<optgroup></optgroup>
<optgroup class="contents red"></optgroup>
<optgroup class="contents green" label="optgroup"></optgroup>
<br>
<select class="red" size="4"></select>
<select size="4" class="red"></select>
<select size="4" class="red"></select>
<select size="4" class="red"><optgroup></select>
<select size="4"></select>
<select size="4" class="red"></select>
<select size="4" class="red"></select>
<select size="4" class="red"></select>
</body>
</html>

View file

@ -0,0 +1,48 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>CSS Test: display:none on OPTION and OPTGROUP</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-display-3/#valdef-display-none">
<link rel="match" href="select-4-option-optgroup-display-none-ref.html">
<style>
.none { display:none; }
.contents { display:contents; }
.red { color: red; }
.green { color: green; }
select { -webkit-appearance: none; }
</style>
</head>
<body>
<pre>FAIL if there is any red color</pre>
<option class="none red">text</option>
<optgroup class="none red">text</optgroup>
<optgroup class="none red"><option>option</option></optgroup>
<optgroup><option class="none red">option</option></optgroup>
<optgroup class="contents red"><option class="none">option</option></optgroup>
<optgroup class="contents green" label="optgroup"><option class="none red">option</option></optgroup>
<optgroup class="none red" label="optgroup"><option class="red">option</option></optgroup>
<br>
<select class="red" size="4">select</select>
<select size="4" class="red"><optgroup class="none" label="optgroup"></select>
<select size="4" class="red"><option class="none">option</select>
<select size="4" class="red"><optgroup><option class="none">option</select>
<select size="4"><optgroup class="none"><option class="green">option</select>
<select size="4" class="red"><optgroup class="none green" label="optgroup"><option>option</select>
<select size="4" class="red"><optgroup class="none"><option class="none">option</select>
<select size="4" class="red"><optgroup class="none green" label="optgroup"><option class="none">option</select>
</body>
</html>

View file

@ -0,0 +1,64 @@
<!DOCTYPE html>
<title>Tests correct handling of min-height: min-content with dynamic changes</title>
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#resolve-flexible-lengths" title="4.5. Implied Minimum Size of Flex Items" />
<link rel="author" title="Google Inc." href="http://www.google.com/">
<link href="support/flexbox.css" rel="stylesheet">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<style>
.container {
height: 300px;
outline: 2px solid black;
}
.inner
{
width: 400px;
flex: 1;
background-color: green;
}
#container2 .flexbox > * { flex-basis: 0; }
#container2 .column > * { flex-basis: auto; }
.container .flexbox { min-height: min-content; }
.container > .flexbox { min-height: 0; }
</style>
<script>
function change() {
var container = document.getElementById('container');
container.offsetHeight;
container.style.height = '80px';
container = document.getElementById('container2');
container.offsetHeight;
container.style.height = '80px';
checkLayout('.container');
}
</script>
<body onload="change()">
<p>Green rectangle should be entirely within the black rectangle</p>
<div id="log"></div>
<div id="container" class="container">
<div class="flexbox column" style="height: 100%;">
<div class="flexbox flex-one">
<div class="flexbox column">
<div class="flexbox column flex-one">
<div class="inner" data-expected-height="80">
</div>
</div>
</div>
</div>
</div>
</div>
<div id="container2" class="container">
<div class="flexbox column" style="height: 100%;">
<div class="flexbox flex-one">
<div class="flexbox column">
<div class="flexbox column flex-one">
<div class="inner" data-expected-height="80">
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-window-screenleft">
<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-window-screentop">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
assert_equals(typeof window.screenLeft, "number", "screenLeft type");
assert_equals(window.screenLeft, window.screenX, "alias of screenX");
}, "screenLeft");
test(() => {
assert_equals(typeof window.screenTop, "number", "screenTop type");
assert_equals(window.screenTop, window.screenY, "alias of screenY");
}, "screenTop");
</script>

View file

@ -35,4 +35,12 @@
assert_equals(CSS.supports("width", "blah"), false, "CSS.supports: two argument form fails for invalid value");
assert_equals(CSS.supports("--foo", "blah"), true, "CSS.supports: two argument form succeeds for custom property");
}, "CSS.supports, two argument form");
test(function () {
assert_equals(CSS.supports("selector(div)"), true, "CSS.supports: selector() function accepts a selector");
assert_equals(CSS.supports("selector(div, div)"), false, "CSS.supports: selector() function doesn't accept a selector list");
assert_equals(CSS.supports("selector(::-webkit-unknown-pseudo-element)"), false, "CSS.supports: selector() function rejects unknown webkit pseudo-elements.");
assert_equals(CSS.supports("selector(::before)"), true, "CSS.supports: selector() function accepts known pseudo-elements");
assert_equals(CSS.supports("selector(div + .c)"), true, "CSS.supports: selector() with simple combinators");
assert_equals(CSS.supports("selector(div | .c)"), false, "CSS.supports: selector() with unknown combinators");
}, "CSS.supports, selector function");
</script>

View file

@ -12,7 +12,7 @@ To run Safari on macOS, some manual setup is required:
* Trust the certificate:
`security add-trusted-cert -k "$(security default-keychain | cut -d\" -f2)" tools/certs/cacert.pem`
* Set `OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES` in your environment. This is a
* Set `no_proxy='*'` in your environment. This is a
workaround for a known
[macOS High Sierra issue](https://github.com/web-platform-tests/wpt/issues/9007).

View file

@ -2,17 +2,17 @@
var browserTests = [
['<div contenteditable="true"><table><tr><td>[fsdf]</td><td>fsdf</td></tr><tr><td>gghfg</td><td>fsfg</td></tr></table></div>',
[["insertOrderedList",""]],
'<div contenteditable="true"><table><tbody><tr><td><ol><li>fsdf<br></li></ol></td><td>fsdf</td></tr><tr><td>gghfg</td><td>fsfg</td></tr></tbody></table></div>',
'<div contenteditable="true"><table><tbody><tr><td><ol><li>fsdf</li></ol></td><td>fsdf</td></tr><tr><td>gghfg</td><td>fsfg</td></tr></tbody></table></div>',
[true],
{"insertOrderedList":[false,false,"false",false,true,"true"]}],
['<div contenteditable="true"><table><tr data-start=0 data-end=2><td>fsdf</td><td>fsdf</td></tr><tr><td>gghfg</td><td>fsfg</td></tr></table></div>',
[["insertOrderedList",""]],
'<div contenteditable="true"><table><tbody><tr><td><ol><li>fsdf<br></li></ol></td><td><ol><li>fsdf<br></li></ol></td></tr><tr><td>gghfg</td><td>fsfg</td></tr></tbody></table></div>',
'<div contenteditable="true"><table><tbody><tr><td><ol><li>fsdf</li></ol></td><td><ol><li>fsdf</li></ol></td></tr><tr><td>gghfg</td><td>fsfg</td></tr></tbody></table></div>',
[true],
{"insertOrderedList":[false,false,"false",false,false,"false"]}],
['<div contenteditable="true"><table><tr data-start=0><td>fsdf</td><td>fsdf</td></tr><tr data-end=2><td>gghfg</td><td>fsfg</td></tr></table></div>',
[["insertOrderedList",""]],
'<div contenteditable="true"><table><tbody><tr><td><ol><li>fsdf<br></li></ol></td><td><ol><li>fsdf<br></li></ol></td></tr><tr><td><ol><li>gghfg<br></li></ol></td><td><ol><li>fsfg<br></li></ol></td></tr></tbody></table></div>',
'<div contenteditable="true"><table><tbody><tr><td><ol><li>fsdf</li></ol></td><td><ol><li>fsdf</li></ol></td></tr><tr><td><ol><li>gghfg</li></ol></td><td><ol><li>fsfg</li></ol></td></tr></tbody></table></div>',
[true],
{"insertOrderedList":[false,false,"false",false,false,"false"]}],
['<div contenteditable="true"><table data-start=0 data-end=1><tr><td>fsdf</td><td>fsdf</td></tr><tr><td>gghfg</td><td>fsfg</td></tr></table></div>',

View file

@ -674,5 +674,20 @@ var browserTests = [
[["defaultparagraphseparator","p"],["insertorderedlist",""]],
"<ol><li>foo</li> <li>[bar]</li> <li>baz</li></ol>",
[true,true],
{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertorderedlist":[false,false,"",false,true,""]}]
{"defaultparagraphseparator":[false,false,"div",false,false,"p"],"insertorderedlist":[false,false,"",false,true,""]}],
["<div><span style='font-family: times; color: blue'>[bar]</span></div>",
[["insertorderedlist",""]],
"<ol><li><span style=\"font-family:times; color:rgb(0, 0, 255)\">[bar]</span></li></ol>",
[true],
{"insertorderedlist":[false,false,"false",false,true,"true"]}],
["<div><span style='font-family: times; color: blue'>bar</span></div><span style='font-family: italic; color: green'>[baz]</span>",
[["insertorderedlist",""]],
"<div><span style=\"font-family:times; color:rgb(0, 0, 255)\">bar</span></div><ol><li><span style=\"font-family:italic; color:rgb(0, 128, 0)\">[baz]</span></li></ol>",
[true],
{"insertorderedlist":[false,false,"false",false,true,"true"]}],
["<div><ol style='font-family: times; color: blue'><li>bar</li></ol><span style='font-family: italic; color: green'>[baz]</span></div>",
[["insertorderedlist",""]],
"<ol style=\"font-family:times; color:rgb(0, 0, 255)\"><li>bar</li><li><span style=\"font-family:italic; color:rgb(0, 128, 0)\">[baz]</span></li></ol>",
[true],
{"insertorderedlist":[false,false,"false",false,true,"true"]}],
]

View file

@ -1 +1 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>


View file

@ -1 +1 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>


View file

@ -9,7 +9,7 @@
.then(j => {
assert_header_equals(j.header, {
"cause": undefined,
"destination": "",
"destination": "empty",
"site": "same-origin"
});
});
@ -21,7 +21,7 @@
.then(j => {
assert_header_equals(j.header, {
"cause": undefined,
"destination": "",
"destination": "empty",
"site": "same-site"
});
});
@ -33,7 +33,7 @@
.then(j => {
assert_header_equals(j.header, {
"cause": undefined,
"destination": "",
"destination": "empty",
"site": "cross-site"
});
});

View file

@ -6,30 +6,26 @@
<link id="style" href="https://foo.bar" rel="stylesheet">
<body></body>
<script>
let counter = 0;
document.addEventListener("securitypolicyviolation", (e) => {
counter++;
if (counter == 3) {
promise_test(t => {
expected = {"destination":"report", "site":"same-origin"};
return fetch("/fetch/sec-metadata/resources/record-header.py?retrieve=true&file=report-same-origin")
function generate_test(expected, name) {
async_test(t => {
t.step_timeout(_ => {
return fetch("/fetch/sec-metadata/resources/record-header.py?retrieve=true&file=report-" + name)
.then(response => response.text())
.then(text => assert_header_equals(text, expected));
}, "Same-Origin report");
.then(text => assert_header_equals(text, expected))
.then(_ => t.done());
}, 1000);
}, name + " report");
}
promise_test(t => {
expected = {"destination":"report", "site":"same-site"};
return fetch("/fetch/sec-metadata/resources/record-header.py?retrieve=true&file=report-same-site")
.then(response => response.text())
.then(text => assert_header_equals(text, expected));
}, "Same-site report");
promise_test(t => {
expected = {"destination":"report", "site":"cross-site"};
return fetch("/fetch/sec-metadata/resources/record-header.py?retrieve=true&file=report-cross-site")
.then(response => response.text())
.then(text => assert_header_equals(text, expected));
}, "Cross-site report");
}
});
test(_ => {
let counter = 0;
document.addEventListener("securitypolicyviolation", (e) => {
counter++;
if (counter == 3) {
generate_test({"destination":"report", "site":"same-origin"}, "same-origin");
generate_test({"destination":"report", "site":"same-site"}, "same-site");
generate_test({"destination":"report", "site":"cross-site"}, "cross-site");
}
});
}, "Initialization.");
</script>

View file

@ -2,7 +2,6 @@ function parse_metadata(value) {
let result = {};
value.split(',').forEach(item => {
let parsed = item.trim().split('=');
parsed[1] = parsed[1].trim().replace(/^"|"$/g, '');
result[parsed[0]] = parsed[1];
});
return result;

View file

@ -35,9 +35,9 @@ test(function() {
testExecCommandInputType('insertText', 'bc', 'insertText');
assert_equals(txt.innerHTML, 'abc');
testExecCommandInputType('insertOrderedList', null, 'insertOrderedList');
assert_equals(txt.innerHTML, '<ol><li>abc<br></li></ol>');
assert_equals(txt.innerHTML, '<ol><li>abc</li></ol>');
testExecCommandInputType('insertUnorderedList', null, 'insertUnorderedList');
assert_equals(txt.innerHTML, '<ul><li>abc<br></li></ul>');
assert_equals(txt.innerHTML, '<ul><li>abc</li></ul>');
testExecCommandInputType('insertLineBreak', null, 'insertLineBreak');
testExecCommandInputType('insertParagraph', null, 'insertParagraph');

View file

@ -23,12 +23,12 @@ enum EffectiveConnectionType {
};
[NoInterfaceObject, Exposed=(Window,Worker)]
interface NavigatorNetworkInformation {
readonly attribute NetworkInformation connection;
};
interface NavigatorNetworkInformation {
readonly attribute NetworkInformation connection;
};
Navigator implements NavigatorNetworkInformation;
WorkerNavigator implements NavigatorNetworkInformation;
Navigator implements NavigatorNetworkInformation;
WorkerNavigator implements NavigatorNetworkInformation;
[Exposed=(Window,Worker)]
interface NetworkInformation : EventTarget {

View file

@ -52,5 +52,5 @@ interface CrashReportBody : ReportBody {
dictionary GenerateTestReportParameters {
required DOMString message;
DOMString group;
DOMString group = "default";
};

View file

@ -73,10 +73,3 @@ partial interface GlobalEventHandlers {
attribute EventHandler ontouchmove;
attribute EventHandler ontouchcancel;
};
partial interface Document {
// Deprecated in this specification
Touch createTouch(WindowProxy view, EventTarget target, long identifier, double pageX, double pageY, double screenX, double screenY);
// Deprecated in this specification
TouchList createTouchList(Touch... touches);
};

View file

@ -1,77 +0,0 @@
<!doctype html>
<meta charset="utf8">
<link rel="help" href="https://w3c.github.io/payment-request/#dom-paymentitem-type">
<title>
PaymentItem type member
</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const validMethods = [
{ supportedMethods: "basic-card" },
{ supportedMethods: "https://apple.com/apple-pay" },
];
const validTotal = {
label: "Total",
amount: {
currency: "USD",
value: "5.00",
},
};
const validDisplayItem = {
label: "Item",
amount: {
currency: "USD",
value: "1.00",
},
};
const validDetails = {
total: validTotal,
displayItems: [validDisplayItem],
};
test(() => {
new PaymentRequest(validMethods, validDetails);
}, "Smoke test");
test(() => {
// Let's make an invalid DisplayItem for the total
const invalidTotal = Object.assign({}, validTotal, {
type: "this is not valid",
});
const invalidDetails = Object.assign({}, validDetails, {
total: invalidTotal,
});
assert_throws(new TypeError(), () => {
new PaymentRequest(validMethods, invalidDetails);
});
}, "An invalid enum value for PaymentDetailsInit.total's type throws TypeError");
test(() => {
// Let's make an invalid DisplayItem to add to displayItems
const invalidDisplayItem = Object.assign({}, validDisplayItem, {
type: "this is not valid",
});
const invalidDetails = Object.assign({}, validDetails, {
displayItems: [invalidDisplayItem, validDisplayItem],
});
assert_throws(new TypeError(), () => {
new PaymentRequest(validMethods, invalidDetails);
});
}, "Invalid enum value for PaymentItem.type member throws a TypeError");
test(() => {
// Let's make an invalid DisplayItem to add to displayItems
const taxDisplayItem = Object.assign({}, validDisplayItem, { type: "tax" });
const taxTotal = Object.assign({}, validTotal, { type: "tax" });
const validDetailsWithType = Object.assign({}, validDetails, {
total: taxTotal,
displayItems: [taxDisplayItem],
});
try {
new PaymentRequest(validMethods, validDetailsWithType);
} catch (err) {
assert_unexpected(err.message);
}
}, "Valid enum values for PaymentItem.type member does not throw");
</script>

View file

@ -4,6 +4,7 @@ import os
import ssl
import html5lib
import py
import pytest
from selenium import webdriver
from six import text_type
@ -16,9 +17,11 @@ WPT_ROOT = os.path.normpath(os.path.join(HERE, '..', '..'))
HARNESS = os.path.join(HERE, 'harness.html')
TEST_TYPES = ('functional', 'unit')
def pytest_addoption(parser):
parser.addoption("--binary", action="store", default=None, help="path to browser binary")
def pytest_collect_file(path, parent):
if path.ext.lower() != '.html':
return
@ -28,6 +31,7 @@ def pytest_collect_file(path, parent):
return HTMLItem(str(path), test_type, parent)
def pytest_configure(config):
config.driver = webdriver.Firefox(firefox_binary=config.getoption("--binary"))
config.add_cleanup(config.driver.quit)
@ -46,6 +50,7 @@ def pytest_configure(config):
config.ssl_context = ssl._create_unverified_context()
config.add_cleanup(config.server.stop)
def resolve_uri(context, uri):
if uri.startswith('/'):
base = WPT_ROOT
@ -56,6 +61,7 @@ def resolve_uri(context, uri):
return os.path.exists(os.path.join(base, path))
class HTMLItem(pytest.Item, pytest.Collector):
def __init__(self, filename, test_type, parent):
self.url = parent.session.config.server.url(filename)
@ -116,7 +122,7 @@ class HTMLItem(pytest.Item, pytest.Collector):
# This cannot use super(HTMLItem, self).__init__(..) because only the
# Collector constructor takes the fspath argument.
pytest.Item.__init__(self, name, parent)
pytest.Collector.__init__(self, name, parent, fspath=filename)
pytest.Collector.__init__(self, name, parent, fspath=py.path.local(filename))
def reportinfo(self):

View file

@ -6,19 +6,6 @@
<script>
'use strict';
// Constraint parameter has a default value of {audio:false, video: false}.
promise_test(function() {
assert_idl_attribute(navigator, 'getDisplayMedia');
return navigator.getDisplayMedia()
.then(function(s) {
fail('getDisplayMedia should have failed');
})
.catch(function(e) {
assert_equals(e.name, 'TypeError');
});
}, 'getDisplayMedia() with no constraints');
promise_test(function() {
assert_idl_attribute(navigator, 'getDisplayMedia');
@ -28,18 +15,35 @@ promise_test(function() {
});
}, 'getDisplayMedia() with video true');
// Empty constraint parameter and boolean values of false defaults to
// {video: true}.
promise_test(function() {
assert_idl_attribute(navigator, 'getDisplayMedia');
return navigator.getDisplayMedia({video: false})
.then(function(s) {
fail('getDisplayMedia should have failed');
})
.catch(function(e) {
assert_equals(e.name, 'TypeError');
});
return navigator.getDisplayMedia().then(function(s) {
assert_equals(s.getVideoTracks().length, 1);
assert_equals(s.getAudioTracks().length, 0);
});
}, 'getDisplayMedia() with no constraints');
promise_test(function() {
assert_idl_attribute(navigator, 'getDisplayMedia');
return navigator.getDisplayMedia({video: false}).then(function(s) {
assert_equals(s.getVideoTracks().length, 1);
assert_equals(s.getAudioTracks().length, 0);
});
}, 'getDisplayMedia() with video false');
promise_test(function() {
assert_idl_attribute(navigator, 'getDisplayMedia');
return navigator.getDisplayMedia({audio: false}).then(function(s) {
assert_equals(s.getVideoTracks().length, 1);
assert_equals(s.getAudioTracks().length, 0);
});
}, 'getDisplayMedia() with audio false');
promise_test(function() {
assert_idl_attribute(navigator, 'getDisplayMedia');
@ -52,27 +56,52 @@ promise_test(function() {
promise_test(function() {
assert_idl_attribute(navigator, 'getDisplayMedia');
return navigator.getDisplayMedia({audio: false})
return navigator
.getDisplayMedia({video: {advanced: [{zoom: 1}]}})
.then(function(s) {
fail('getDisplayMedia should have failed');
})
.catch(function(e) {
assert_equals(e.name, 'TypeError');
});
}, 'getDisplayMedia() with audio false');
}, 'getDisplayMedia() call with advanced constraint');
promise_test(function() {
assert_idl_attribute(navigator, 'getDisplayMedia');
return navigator
.getDisplayMedia({audio: false, video: {width: 1280, height: 720}})
.getDisplayMedia({video: {width: {min: 360}}})
.then(function(s) {
fail('getDisplayMedia should have failed');
})
.catch(function(e) {
assert_equals(e.name, 'InvalidAccessError');
assert_equals(e.name, 'TypeError');
});
}, 'getDisplayMedia() call with non-bool constraint');
}, 'getDisplayMedia() call with min constraint');
promise_test(function() {
assert_idl_attribute(navigator, 'getDisplayMedia');
return navigator
.getDisplayMedia({video: {width: {exact: 360}}})
.then(function(s) {
fail('getDisplayMedia should have failed');
})
.catch(function(e) {
assert_equals(e.name, 'TypeError');
});
}, 'getDisplayMedia() call with exact constraint');
promise_test(function() {
assert_idl_attribute(navigator, 'getDisplayMedia');
return navigator
.getDisplayMedia({video: {width: {max: 360}}})
.then(function(s) {
assert_equals(s.getVideoTracks().length, 1);
assert_equals(s.getAudioTracks().length, 0);
});
}, 'getDisplayMedia() call with max constraint');
// Content shell picks a fake desktop device by default.
promise_test(function() {

View file

@ -31,10 +31,12 @@ def find_wptreport(args):
return parser.parse_known_args(args)[0].log_wptreport
def gzip_file(filename):
def gzip_file(filename, delete_original=True):
with open(filename, 'rb') as f_in:
with gzip.open('%s.gz' % filename, 'wb') as f_out:
shutil.copyfileobj(f_in, f_out)
if delete_original:
os.unlink(filename)
def main(product, commit_range, wpt_args):
@ -67,9 +69,8 @@ def main(product, commit_range, wpt_args):
logger.info("Running all tests")
wpt_args += [
"--log-tbpl=../artifacts/log_tbpl.log",
"--log-tbpl-level=info",
"--log-mach=-",
"--log-tbpl=-",
"-y",
"--no-pause",
"--no-restart-on-unexpected",

View file

@ -264,7 +264,7 @@ class Firefox(Browser):
dest = os.path.join(dest, "profiles", channel)
if version:
dest = dest.join(version)
dest = os.path.join(dest, version)
have_cache = False
if os.path.exists(dest):
if channel != "nightly":
@ -711,11 +711,15 @@ class Servo(Browser):
def version(self, binary):
"""Retrieve the release version of the installed browser."""
output = call(binary, "--version")
m = re.search(r"[0-9\.]+( [a-z]+)?$", output.strip())
m = re.search(r"Servo ([0-9\.]+-[a-f0-9]+)?(-dirty)?$", output.strip())
if m:
return m.group(0)
class ServoWebDriver(Servo):
product = "servodriver"
class Sauce(Browser):
"""Sauce-specific interface."""

View file

@ -414,6 +414,11 @@ class Servo(BrowserSetup):
kwargs["binary"] = binary
class ServoWebDriver(Servo):
name = "servodriver"
browser_cls = browser.ServoWebDriver
class WebKit(BrowserSetup):
name = "webkit"
browser_cls = browser.WebKit
@ -436,7 +441,7 @@ product_setup = {
"safari": Safari,
"safari_webdriver": SafariWebDriver,
"servo": Servo,
"servodriver": Servo,
"servodriver": ServoWebDriver,
"sauce": Sauce,
"opera": Opera,
"webkit": WebKit,
@ -482,7 +487,7 @@ def setup_wptrunner(venv, prompt=True, install_browser=False, **kwargs):
if channel != kwargs["channel"]:
logger.info("Interpreting channel '%s' as '%s'" % (kwargs["channel"],
channel))
kwargs["browser_channel"] = channel
kwargs["browser_channel"] = channel
else:
logger.info("Valid channels for %s not known; using argument unmodified" % kwargs["product"])
del kwargs["channel"]

View file

@ -4,7 +4,7 @@ import tempfile
from mozprocess import ProcessHandler
from serve.serve import make_hosts_file
from tools.serve.serve import make_hosts_file
from .base import Browser, require_arg, get_free_port, browser_command, ExecutorBrowser
from ..executors import executor_kwargs as base_executor_kwargs