Auto merge of #27347 - servo-wpt-sync:wpt_update_21-07-2020, r=servo-wpt-sync

Sync WPT with upstream (21-07-2020)

Automated downstream sync of changes from upstream as of 21-07-2020.
[no-wpt-sync]
r? @servo-wpt-sync
This commit is contained in:
bors-servo 2020-07-21 06:58:06 -04:00 committed by GitHub
commit fdbecc68cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 254 additions and 153 deletions

View file

@ -4,7 +4,7 @@
expected: TIMEOUT
[Opening a blob URL in a new window immediately before revoking it works.]
expected: TIMEOUT
expected: FAIL
[Fetching a blob URL immediately before revoking it works in an iframe.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[Hit test intersecting scaled box]
expected: FAIL
[Hit test within unscaled box]
expected: FAIL

View file

@ -14,6 +14,6 @@
[test some point of the element: bottom right corner]
expected: FAIL
[test the top of layer]
[test some point of the element: top left corner]
expected: FAIL

View file

@ -312,24 +312,18 @@
[Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK]
expected: NOTRUN
[<iframe>: combined response Content-Type: */* text/html]
expected: FAIL
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: combined response Content-Type: text/html */*]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*]
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain ]
expected: FAIL

View file

@ -11,6 +11,6 @@
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
expected: FAIL
[X-Content-Type-Options%3A%20%40%23%24%23%25%25%26%5E%26%5E*()()11!%2Cnosniff]
[X-Content-Type-Options%3A%20no%0D%0AX-Content-Type-Options%3A%20nosniff]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_2.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_5.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -0,0 +1,4 @@
[creating_browsing_context_test_01.html]
[first argument: absolute url]
expected: FAIL

View file

@ -33,3 +33,9 @@
[createImageBitmap in e-sRGB from an opaque sRGB Blob with resize.]
expected: NOTRUN
[createImageBitmap in e-sRGB from a transparent sRGB Blob (BMP, ICO, PNG, WEBP) with resize.]
expected: NOTRUN
[createImageBitmap in e-sRGB from an opaque sRGB Blob (BMP, GIF, ICO, JPG, PNG, WEBP) with resize.]
expected: NOTRUN

View file

@ -1,5 +1,5 @@
[iframe_sandbox_popups_escaping-1.html]
expected: TIMEOUT
expected: CRASH
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT

View file

@ -1,4 +1,5 @@
[iframe_sandbox_popups_escaping-3.html]
expected: CRASH
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: FAIL

View file

@ -1,4 +1,5 @@
[iframe_sandbox_popups_nonescaping-1.html]
expected: CRASH
[Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL

View file

@ -1,4 +1,5 @@
[iframe_sandbox_popups_nonescaping-2.html]
expected: CRASH
[Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL

View file

@ -1,4 +1,5 @@
[iframe_sandbox_popups_nonescaping-3.html]
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL
expected: NOTRUN

View file

@ -0,0 +1,4 @@
[form-double-submit-2.html]
[preventDefault should allow onclick submit() to succeed]
expected: FAIL

View file

@ -1,5 +1,5 @@
[ignore-opens-during-unload.window.html]
expected: CRASH
expected: TIMEOUT
[document.open should bail out when ignore-opens-during-unload is greater than 0 during visibilitychange event (open(parent) while unloading parent and child)]
expected: TIMEOUT

View file

@ -1,7 +1,6 @@
[entry.html]
expected: TIMEOUT
[Start function]
expected: TIMEOUT
expected: FAIL
[Sanity check: this all works as expected synchronously]
expected: FAIL

View file

@ -1,4 +1,5 @@
[realtimeanalyser-fft-scaling.html]
expected: TIMEOUT
[X 2048-point FFT peak position is not equal to 64. Got 0.]
expected: FAIL

View file

@ -0,0 +1,5 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -1,4 +1,5 @@
[xrBoundedReferenceSpace_updates.https.html]
expected: ERROR
['XRBoundedReferenceSpace updates properly when the changes are applied]
expected: FAIL
expected: TIMEOUT

View file

@ -1,4 +1,5 @@
[xrReferenceSpace_originOffsetBounded.https.html]
expected: ERROR
[Updating XRBoundedReferenceSpace origin offset updates view, input matrices, and bounds geometry.]
expected: FAIL
expected: TIMEOUT

View file

@ -7,7 +7,7 @@
expected: FAIL
[Opening a blob URL in a new window immediately before revoking it works.]
expected: TIMEOUT
expected: FAIL
[Opening a blob URL in a noopener about:blank window immediately before revoking it works.]
expected: TIMEOUT

View file

@ -356054,7 +356054,7 @@
[]
],
"browser.py": [
"4423afd9c4f7c8b866ffbff2f5343ec5fe65e650",
"cb5974078a8022d30402a5dac8137470e8fd1ecc",
[]
],
"commands.json": [
@ -356066,7 +356066,7 @@
[]
],
"install.py": [
"6eb59f814bf08d139d597a4b4b26a7d7aa920fd6",
"1fe091879b5ca04c16e9c965380b97025ec74521",
[]
],
"mach-emulator.manifest": [
@ -356090,7 +356090,7 @@
[]
],
"run.py": [
"e977b9a0d36ee4f05072b4ff6554bd8ddb85d09e",
"9c77c57ab3779090caef1dd44efad15794908705",
[]
],
"testfiles.py": [
@ -356103,7 +356103,7 @@
[]
],
"test_browser.py": [
"e7c32a3621186086102d5b44aade3c7f175f07aa",
"495d5f056fc1bd898047c7a46220fa523ffb4093",
[]
],
"test_markdown.py": [
@ -358326,6 +358326,10 @@
"d2eccca6f424e93cc463fafc5a3b16e5a7ecc565",
[]
],
"disabled-by-feature-policy.https.sub.html.headers": [
"a9b2b95074245b7319d360303c2ff1d9d05655c5",
[]
],
"resources": {
"manual-helper.js": [
"15bb17936e4479f7338b7cefbaa87522a2a02df4",
@ -434110,7 +434114,7 @@
]
],
"request-init-stream.any.js": [
"e7ffa729d15b841e307d49cbdc7994ce78b2f059",
"8c50c4929e75dacb61a3a74054a169ae2346bbd8",
[
"fetch/api/request/request-init-stream.any.html",
{
@ -442512,7 +442516,7 @@
]
],
"canvas-createImageBitmap-e_srgb.html": [
"9cad95a87ba552bba2b055e97f048b3589f993a5",
"829e120df45fd43b7f34616ca1385d8dbee9ccf5",
[
null,
{}
@ -456701,7 +456705,7 @@
]
],
"property.https.html": [
"994b73d6b598a5763e5889d6012c82a61c240641",
"dfa738075de58f7c979c007d768db9e5f131a422",
[
null,
{
@ -476538,7 +476542,7 @@
]
],
"mpadded-002.html": [
"5eed04bb0f599998db531bb56badf07e59129a11",
"d376bd3da1f60d3f4c7e7b9294095e35598f853a",
[
null,
{}
@ -520173,6 +520177,15 @@
{}
]
],
"disabled-by-feature-policy.https.sub.html": [
"9c1893232997ac27d493d54c74d0bfd0b8b8888b",
[
null,
{
"testdriver": true
}
]
],
"idlharness.https.window.js": [
"fbe59864af99c0a55b83e942f0e40f4d45de72a6",
[

View file

@ -2,3 +2,6 @@
[Hit test intersecting scaled box]
expected: FAIL
[Hit test within unscaled box]
expected: FAIL

View file

@ -18,6 +18,6 @@
[test some point of the element: bottom right corner]
expected: FAIL
[test the top of layer]
[test some point of the element: top left corner]
expected: FAIL

View file

@ -312,24 +312,18 @@
[fetch(): separate response Content-Type: text/plain ]
expected: NOTRUN
[<iframe>: combined response Content-Type: */* text/html]
expected: FAIL
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: combined response Content-Type: text/html */*]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*]
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain ]
expected: FAIL

View file

@ -11,6 +11,6 @@
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
expected: FAIL
[X-Content-Type-Options%3A%20%40%23%24%23%25%25%26%5E%26%5E*()()11!%2Cnosniff]
[X-Content-Type-Options%3A%20no%0D%0AX-Content-Type-Options%3A%20nosniff]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_2.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_5.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -0,0 +1,4 @@
[creating_browsing_context_test_01.html]
[first argument: absolute url]
expected: FAIL

View file

@ -33,3 +33,9 @@
[createImageBitmap in e-sRGB from an opaque sRGB Blob with resize.]
expected: NOTRUN
[createImageBitmap in e-sRGB from a transparent sRGB Blob (BMP, ICO, PNG, WEBP) with resize.]
expected: NOTRUN
[createImageBitmap in e-sRGB from an opaque sRGB Blob (BMP, GIF, ICO, JPG, PNG, WEBP) with resize.]
expected: NOTRUN

View file

@ -1,6 +1,6 @@
[iframe_sandbox_popups_escaping-1.html]
type: testharness
expected: TIMEOUT
expected: CRASH
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT

View file

@ -1,5 +1,6 @@
[iframe_sandbox_popups_escaping-3.html]
type: testharness
expected: CRASH
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: FAIL

View file

@ -1,5 +1,6 @@
[iframe_sandbox_popups_nonescaping-1.html]
type: testharness
expected: CRASH
[Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL

View file

@ -1,5 +1,6 @@
[iframe_sandbox_popups_nonescaping-2.html]
type: testharness
expected: CRASH
[Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL

View file

@ -1,5 +1,6 @@
[iframe_sandbox_popups_nonescaping-3.html]
type: testharness
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL
expected: NOTRUN

View file

@ -0,0 +1,4 @@
[form-double-submit-2.html]
[preventDefault should allow onclick submit() to succeed]
expected: FAIL

View file

@ -1,5 +1,5 @@
[ignore-opens-during-unload.window.html]
expected: CRASH
expected: TIMEOUT
[ignore-opens-during-unload]
expected: FAIL

View file

@ -1,7 +1,6 @@
[entry.html]
expected: TIMEOUT
[Start function]
expected: TIMEOUT
expected: FAIL
[Sanity check: this all works as expected synchronously]
expected: FAIL

View file

@ -1,4 +1,5 @@
[realtimeanalyser-fft-scaling.html]
expected: TIMEOUT
[X 2048-point FFT peak position is not equal to 64. Got 0.]
expected: FAIL

View file

@ -0,0 +1,5 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -1,5 +1,5 @@
[xrBoundedReferenceSpace_updates.https.html]
expected: TIMEOUT
expected: ERROR
['XRBoundedReferenceSpace updates properly when the changes are applied]
expected: FAIL
expected: TIMEOUT

View file

@ -1,5 +1,5 @@
[xrReferenceSpace_originOffsetBounded.https.html]
expected: TIMEOUT
expected: ERROR
[Updating XRBoundedReferenceSpace origin offset updates view, input matrices, and bounds geometry.]
expected: FAIL
expected: TIMEOUT

View file

@ -2,6 +2,12 @@
"use strict";
test(() => {
const stream = new ReadableStream();
const request = new Request("...", { method:"POST", body: stream });
assert_equals(request.body, stream);
}, "Constructing a Request with a stream holds the original object.");
async function assert_request(test, input, init) {
assert_throws_js(TypeError, () => new Request(input, init), "new Request()");
await promise_rejects_js(test, TypeError, fetch(input, init), "fetch()");

View file

@ -298,7 +298,7 @@ promise_test(function() {
GIF, ICO, JPG, PNG, WEBP) with resize.');
// HTMLImageElement - Transparent sRGB
// File formats: Bitmap, GIF, ICO, PNG, WEBP
// File formats: Bitmap, ICO, PNG, WEBP
promise_test(function() {
return Promise.all(['bmp', 'ico', 'png', 'webp'].map(
ext => new Promise((resolve,reject) => {
@ -369,30 +369,36 @@ promise_test(function() {
//////////////////////////////////////////////////////////////////////////////
// Blob from file - Opaque sRGB
// File formats: Bitmap, GIF, ICO, JPEG, PNG, WEBP
promise_test(function() {
return new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.open("GET", 'resources/pattern-srgb.png');
xhr.responseType = 'blob';
xhr.send();
xhr.onload = function() {
resolve(xhr.response);
};
}).then(testImageBitmapOpaque);
}, 'createImageBitmap in e-sRGB from an opaque sRGB Blob with resize.');
return Promise.all(['bmp', 'gif', 'ico', 'jpg', 'png', 'webp'].map(
ext => new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.open("GET", 'resources/pattern-srgb.' + ext);
xhr.responseType = 'blob';
xhr.send();
xhr.onload = function() {
resolve(xhr.response);
};
}).then(testImageBitmapOpaque)));
}, 'createImageBitmap in e-sRGB from an opaque sRGB Blob (BMP, GIF, ICO, JPG, \
PNG, WEBP) with resize.');
// Blob form file - Transparent sRGB
// File formats: Bitmap, ICO, PNG, WEBP
promise_test(function() {
return new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.open("GET", 'resources/pattern-srgb-transparent.png');
xhr.responseType = 'blob';
xhr.send();
xhr.onload = function() {
resolve(xhr.response);
};
}).then(testImageBitmapFromTransparentImage);
}, 'createImageBitmap in e-sRGB from a transparent sRGB Blob with resize.');
return Promise.all(['bmp', 'ico', 'png', 'webp'].map(
ext => new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.open("GET", 'resources/pattern-srgb-transparent.' + ext);
xhr.responseType = 'blob';
xhr.send();
xhr.onload = function() {
resolve(xhr.response);
};
}).then(testImageBitmapFromTransparentImage)));
}, 'createImageBitmap in e-sRGB from a transparent sRGB Blob (BMP, ICO, PNG, \
WEBP) with resize.');
// Color managed blob from canvas
function testCreateImageBitmapFromColorManagedBlob(pixelFormat, isTransparent) {

View file

@ -7,7 +7,7 @@
<script src="../resources/dispatcher.js"></script>
<script>
const directory = "/html/cross-origin-opener-policy/access-reporting";
const directory = "/html/cross-origin-opener-policy/reporting";
const executor_path = directory + "/resources/executor.html?pipe=";
const coep_header = '|header(Cross-Origin-Embedder-Policy,require-corp)';

View file

@ -21,7 +21,7 @@
const contentDepth = 125;
const contentHeight = 150;
test(function() {
test(function() {
var none = getBox("none");
assert_equals(none.width, contentWidth, "content width");
assert_approx_equals(getBox("baseline").bottom - none.top, contentHeight, epsilon, "content height");
@ -46,12 +46,19 @@
}
}, "Different heights");
test(function() {
var mpadded = getBox("percentages");
assert_equals(mpadded.width, contentWidth / 2, "width");
assert_approx_equals(getBox("baseline").bottom - mpadded.top, contentHeight / 3, epsilon, "height");
assert_approx_equals(mpadded.bottom - getBox("baseline").bottom, contentDepth, epsilon, "depth");
}, "Percentage calculation for width, height and depth");
test(function() {
for (var i = 0; i <= 2; i++) {
var mpadded = getBox("depth" + i);
assert_equals(mpadded.width, contentWidth, "width" + i);
assert_approx_equals(getBox("baseline2").bottom - mpadded.top, contentHeight, epsilon, "height" + i);
assert_approx_equals(mpadded.bottom - getBox("baseline").bottom, 25*(i+1), epsilon, "depth" + i);
assert_approx_equals(mpadded.bottom - getBox("baseline2").bottom, 25*(i+1), epsilon, "depth" + i);
}
}, "Different depths");
@ -60,7 +67,7 @@
var mpadded = getBox("mpadded" + i);
assert_approx_equals(mpadded.width, 25*(1+i%3), epsilon, "width" + i);
assert_approx_equals(getBox("baseline2").bottom - mpadded.top, 25*(1+(i+1)%3), epsilon, "height" + i);
assert_approx_equals(mpadded.bottom - getBox("baseline").bottom, 25*(1+(i+2)%3), epsilon, "depth" + i);
assert_approx_equals(mpadded.bottom - getBox("baseline2").bottom, 25*(1+(i+2)%3), epsilon, "depth" + i);
}
}, "Various combinations of height, depth and width.");
@ -126,6 +133,7 @@ div.shrink-wrap {
<mpadded id="height0" height="25px"><mspace width="100px" depth="125px" height="150px" style="background: black; opacity: .5"/></mpadded>
<mpadded id="height1" height="50px"><mspace width="100px" depth="125px" height="150px" style="background: black; opacity: .5"/></mpadded>
<mpadded id="height2" height="75px"><mspace width="100px" depth="125px" height="150px" style="background: black; opacity: .5"/></mpadded>
<mpadded id="percentages" width="50%" height="33%" depth="100%"><mspace width="100px" depth="125px" height="150px" style="background: black; opacity: .5"/></mpadded>
</math>
</p>
<p>

View file

@ -70,17 +70,31 @@ class Browser(object):
:param channel: Browser channel to download
:param rename: Optional name for the downloaded package; the original
extension is preserved.
:return: The path to the downloaded package/installer
"""
return NotImplemented
@abstractmethod
def install(self, dest=None):
"""Install the browser."""
def install(self, dest=None, channel=None):
"""Download and install the browser.
This method usually calls download().
:param dest: Directory in which to install the browser
:param channel: Browser channel to install
:return: The path to the installed browser
"""
return NotImplemented
@abstractmethod
def install_webdriver(self, dest=None, channel=None, browser_binary=None):
"""Install the WebDriver implementation for this browser."""
"""Download and install the WebDriver implementation for this browser.
:param dest: Directory in which to install the WebDriver
:param channel: Browser channel to install
:param browser_binary: The path to the browser binary
:return: The path to the installed WebDriver
"""
return NotImplemented
@abstractmethod
@ -387,14 +401,14 @@ class Firefox(Browser):
tags = call("git", "ls-remote", "--tags", "--refs",
"https://github.com/mozilla/geckodriver.git")
release_re = re.compile(r".*refs/tags/v(\d+)\.(\d+)\.(\d+)")
latest_release = (0,0,0)
latest_release = (0, 0, 0)
for item in tags.split("\n"):
m = release_re.match(item)
if m:
version = tuple(int(item) for item in m.groups())
if version > latest_release:
latest_release = version
assert latest_release != (0,0,0)
assert latest_release != (0, 0, 0)
return "v%s.%s.%s" % tuple(str(item) for item in latest_release)
def install_webdriver(self, dest=None, channel=None, browser_binary=None):
@ -470,11 +484,14 @@ class FirefoxAndroid(Browser):
product = "firefox_android"
requirements = "requirements_firefox.txt"
def __init__(self, logger):
super(FirefoxAndroid, self).__init__(logger)
self.apk_path = None
def download(self, dest=None, channel=None, rename=None):
if dest is None:
dest = os.pwd
resp = get_taskcluster_artifact(
"gecko.v2.mozilla-central.latest.mobile.android-x86_64-opt",
"public/build/geckoview-androidTest.apk")
@ -482,12 +499,12 @@ class FirefoxAndroid(Browser):
filename = "geckoview-androidTest.apk"
if rename:
filename = "%s%s" % (rename, get_ext(filename)[1])
apk_path = os.path.join(dest, filename)
self.apk_path = os.path.join(dest, filename)
with open(apk_path, "wb") as f:
with open(self.apk_path, "wb") as f:
f.write(resp.content)
return apk_path
return self.apk_path
def install(self, dest=None, channel=None):
return self.download(dest, channel)
@ -497,7 +514,7 @@ class FirefoxAndroid(Browser):
return fx_browser.install_prefs(binary, dest, channel)
def find_binary(self, venv_path=None, channel=None):
raise NotImplementedError
return self.apk_path
def find_webdriver(self, channel=None):
raise NotImplementedError
@ -730,9 +747,9 @@ class ChromeAndroid(ChromeAndroidBase):
return "com.android.chrome"
#TODO(aluo): This is largely copied from the AndroidWebView implementation.
# Tests are not running for weblayer yet (crbug/1019521), this
# initial implementation will help to reproduce and debug any issues.
# TODO(aluo): This is largely copied from the AndroidWebView implementation.
# Tests are not running for weblayer yet (crbug/1019521), this initial
# implementation will help to reproduce and debug any issues.
class AndroidWeblayer(ChromeAndroidBase):
"""Weblayer-specific interface for Android."""

View file

@ -1,5 +1,4 @@
import argparse
import sys
from . import browser
latest_channels = {
@ -22,25 +21,27 @@ channel_by_name = {
'canary': 'canary',
}
channel_args = argparse.ArgumentParser(add_help=False)
channel_args.add_argument('--channel', choices=channel_by_name.keys(),
default='nightly', action='store',
help='''
Name of browser release channel (default: nightly). "stable" and "release" are
synonyms for the latest browser stable release; "beta" is the beta release;
"dev" is only meaningful for Chrome (i.e. Chrome Dev); "nightly",
"experimental", and "preview" are all synonyms for the latest available
development or trunk release. (For WebDriver installs, we attempt to select an
appropriate, compatible version for the latest browser release on the selected
channel.) This flag overrides --browser-channel.''')
def get_parser():
parser = argparse.ArgumentParser(description="""Install a given browser or webdriver frontend.
For convenience the release channel of the browser accepts various spellings,
but we actually support at most three variants; whatever the latest development
release is (e.g. Firefox nightly or Chrome dev), the latest beta release, and
the most recent stable release.""")
parser = argparse.ArgumentParser(
parents=[channel_args],
description="Install a given browser or webdriver frontend.")
parser.add_argument('browser', choices=['firefox', 'chrome', 'servo'],
help='name of web browser product')
parser.add_argument('component', choices=['browser', 'webdriver'],
help='name of component')
parser.add_argument('--channel', choices=channel_by_name.keys(),
default="nightly", help='Name of browser release channel. '
'"stable" and "release" are synonyms for the latest browser stable release,'
'"nightly", "dev", "experimental", and "preview" are all synonyms for '
'the latest available development release. For WebDriver installs, '
'we attempt to select an appropriate, compatible, version for the '
'latest browser release on the selected channel.')
parser.add_argument('--download-only', action="store_true",
help="Download the selected component but don't install it")
parser.add_argument('--rename', action="store", default=None,
@ -59,13 +60,15 @@ def get_channel(browser, channel):
def run(venv, **kwargs):
import logging
logger = logging.getLogger("install")
browser = kwargs["browser"]
destination = kwargs["destination"]
channel = get_channel(browser, kwargs["channel"])
if channel != kwargs["channel"]:
print("Interpreting channel '%s' as '%s'" % (kwargs["channel"],
channel))
logger.info("Interpreting channel '%s' as '%s'", kwargs["channel"], channel)
if destination is None:
if venv:
@ -77,7 +80,7 @@ def run(venv, **kwargs):
raise argparse.ArgumentError(None,
"No --destination argument, and no default for the environment")
install(browser, kwargs["component"], destination, channel,
install(browser, kwargs["component"], destination, channel, logger=logger,
download_only=kwargs["download_only"], rename=kwargs["rename"])
@ -92,11 +95,11 @@ def install(name, component, destination, channel="nightly", logger=None, downlo
method = prefix + suffix
subclass = getattr(browser, name.title())
sys.stdout.write('Now installing %s %s...\n' % (name, component))
browser_cls = getattr(browser, name.title())
logger.info('Now installing %s %s...', name, component)
kwargs = {}
if download_only and rename:
kwargs["rename"] = rename
path = getattr(subclass(logger), method)(dest=destination, channel=channel, **kwargs)
path = getattr(browser_cls(logger), method)(dest=destination, channel=channel, **kwargs)
if path:
sys.stdout.write('Binary %s as %s\n' % ("downloaded" if download_only else "installed", path,))
logger.info('Binary %s as %s', "downloaded" if download_only else "installed", path)

View file

@ -42,7 +42,7 @@ class WptrunnerHelpAction(argparse.Action):
def create_parser():
from wptrunner import wptcommandline
parser = argparse.ArgumentParser(add_help=False)
parser = argparse.ArgumentParser(add_help=False, parents=[install.channel_args])
parser.add_argument("product", action="store",
help="Browser to run tests in")
parser.add_argument("--affected", action="store", default=None,
@ -52,15 +52,6 @@ def create_parser():
parser.add_argument("--install-browser", action="store_true",
help="Install the browser from the release channel specified by --channel "
"(or the nightly channel by default).")
parser.add_argument("--channel", action="store",
choices=install.channel_by_name.keys(),
default=None, help='Name of browser release channel. '
'"stable" and "release" are synonyms for the latest browser stable '
'release, "nightly", "dev", "experimental", and "preview" are all '
'synonyms for the latest available development release. (For WebDriver '
'installs, we attempt to select an appropriate, compatible version for '
'the latest browser release on the selected channel.) '
'This flag overrides --browser-channel.')
parser._add_container_actions(wptcommandline.create_parser())
return parser
@ -182,6 +173,7 @@ class BrowserSetup(object):
def setup(self, kwargs):
self.setup_kwargs(kwargs)
def safe_unsetenv(env_var):
"""Safely remove an environment variable.
@ -193,6 +185,7 @@ def safe_unsetenv(env_var):
except KeyError:
pass
class Firefox(BrowserSetup):
name = "firefox"
browser_cls = browser.Firefox
@ -264,11 +257,6 @@ class FirefoxAndroid(BrowserSetup):
name = "firefox_android"
browser_cls = browser.FirefoxAndroid
def install(self, channel):
# The install needs to happen in setup so that we have access to all the kwargs
self._install_browser = True
return None
def setup_kwargs(self, kwargs):
from . import android
import mozdevice
@ -295,13 +283,6 @@ class FirefoxAndroid(BrowserSetup):
emulator = android.install(logger, reinstall=False, no_prompt=not self.prompt)
android.start(logger, emulator=emulator, reinstall=False)
install = False
if hasattr(self, "_install_browser"):
if self.prompt_install("geckoview-test"):
install = True
apk_path = self.browser.install(self.venv.path,
channel=kwargs["browser_channel"])
if "ADB_PATH" not in os.environ:
adb_path = os.path.join(android.get_sdk_path(None),
"platform-tools",
@ -312,9 +293,9 @@ class FirefoxAndroid(BrowserSetup):
device = mozdevice.ADBDeviceFactory(adb=adb_path,
device=kwargs["device_serial"])
if install:
if self.browser.apk_path:
device.uninstall_app(app)
device.install_app(apk_path)
device.install_app(self.browser.apk_path)
elif not device.is_app_installed(app):
raise WptrunError("app %s not installed on device %s" %
(app, kwargs["device_serial"]))

View file

@ -3,6 +3,7 @@ import subprocess
import logging
import sys
import pytest
import inspect
from tools.wpt import browser
@ -10,6 +11,19 @@ from tools.wpt import browser
logger = logging.getLogger()
def test_all_browser_abc():
# Make sure all subclasses of Browser implement all abstract methods
# (except some known base classes). This is a basic sanity test in case
# we change the ABC interface of Browser as we only instantiate some
# products in unit tests.
classes = inspect.getmembers(browser)
for name, cls in classes:
if cls in (browser.Browser, browser.ChromeAndroidBase):
continue
if inspect.isclass(cls) and issubclass(cls, browser.Browser):
assert not inspect.isabstract(cls), "%s is abstract" % name
@mock.patch('subprocess.check_output')
def test_safari_version(mocked_check_output):
safari = browser.Safari(logger)

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>WebShare Test: Can be disabled by feature policy</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
</head>
<body>
<script>
promise_test(async t => {
await test_driver.bless("web share");
await promise_rejects_dom(t, "NotAllowedError", navigator.share({}));
}, "share can be disabled by feature policy");
</script>
</body>
</html>

View file

@ -0,0 +1 @@
Feature-Policy: web-share 'none'

View file

@ -197,3 +197,9 @@
[WebGL test #50: attachment 5 should be 0,255,0,255\nat (0, 0) expected: 0,255,0,255 was 0,0,0,255]
expected: FAIL
[WebGL test #52: attachment 7 should be 0,255,0,255\nat (0, 0) expected: 0,255,0,255 was 0,255,255,255]
expected: FAIL
[WebGL test #42: attachment 5 should be 0,255,0,255\nat (4, 0) expected: 0,255,0,255 was 255,0,0,0]
expected: FAIL