diff --git a/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini b/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini index 76b44d9e9cf..3605e8f3fc9 100644 --- a/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini +++ b/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini @@ -4,7 +4,7 @@ expected: TIMEOUT [Opening a blob URL in a new window immediately before revoking it works.] - expected: FAIL + expected: TIMEOUT [Fetching a blob URL immediately before revoking it works in an iframe.] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini deleted file mode 100644 index f64b45fea6b..00000000000 --- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[hit-test-floats-002.html] - [Hit test float] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/css-backgrounds/background-attachment-350.html.ini b/tests/wpt/metadata-layout-2020/css/css-backgrounds/background-attachment-350.html.ini new file mode 100644 index 00000000000..8ab2b3e35e3 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-backgrounds/background-attachment-350.html.ini @@ -0,0 +1,2 @@ +[background-attachment-350.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-transitions/KeyframeEffect-setKeyframes.tentative.html.ini b/tests/wpt/metadata-layout-2020/css/css-transitions/KeyframeEffect-setKeyframes.tentative.html.ini index 53ffb60d062..d5ad91a700c 100644 --- a/tests/wpt/metadata-layout-2020/css/css-transitions/KeyframeEffect-setKeyframes.tentative.html.ini +++ b/tests/wpt/metadata-layout-2020/css/css-transitions/KeyframeEffect-setKeyframes.tentative.html.ini @@ -26,3 +26,6 @@ [A transition with replaced keyframes animating nothing still exhibits normal reversing behavior (reversing from the base value).] expected: FAIL + [A transition with replaced kefyrames and composite 'add' exhibits normal reversing behavior, and the effect is not double counted when calculating the before change style] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini deleted file mode 100644 index 4c79907309b..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[CaretPosition-001.html] - [Element at (400, 100)] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini index 831773e5212..392d55789f4 100644 --- a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini +++ b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini @@ -318,15 +318,15 @@ [ + diff --git a/tests/wpt/web-platform-tests/interfaces/media-capabilities.idl b/tests/wpt/web-platform-tests/interfaces/media-capabilities.idl index 08de35ef675..02aa140bc08 100644 --- a/tests/wpt/web-platform-tests/interfaces/media-capabilities.idl +++ b/tests/wpt/web-platform-tests/interfaces/media-capabilities.idl @@ -108,5 +108,5 @@ partial interface WorkerNavigator { [Exposed=(Window, Worker)] interface MediaCapabilities { [NewObject] Promise decodingInfo(MediaDecodingConfiguration configuration); - [NewObject] Promise encodingInfo(MediaEncodingConfiguration configuration); + [NewObject] Promise encodingInfo(MediaEncodingConfiguration configuration); }; diff --git a/tests/wpt/web-platform-tests/interfaces/ua-client-hints.idl b/tests/wpt/web-platform-tests/interfaces/ua-client-hints.idl new file mode 100644 index 00000000000..14e941bd407 --- /dev/null +++ b/tests/wpt/web-platform-tests/interfaces/ua-client-hints.idl @@ -0,0 +1,32 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into reffy-reports +// (https://github.com/tidoust/reffy-reports) +// Source: User-Agent Client Hints (https://wicg.github.io/ua-client-hints/) + +dictionary NavigatorUABrandVersion { + DOMString brand; + DOMString version; +}; + +dictionary UADataValues { + DOMString platform; + + DOMString platformVersion; + DOMString architecture; + DOMString model; + DOMString uaFullVersion; +}; + +[Exposed=(Window,Worker)] +interface NavigatorUAData { + readonly attribute FrozenArray brands; + readonly attribute boolean mobile; + Promise getHighEntropyValues(sequence hints); +}; + +interface mixin NavigatorUA { + [SecureContext] readonly attribute NavigatorUAData userAgentData; +}; + +Navigator includes NavigatorUA; +WorkerNavigator includes NavigatorUA; diff --git a/tests/wpt/web-platform-tests/resources/idlharness.js b/tests/wpt/web-platform-tests/resources/idlharness.js index 62b003c4a7a..fa24275648f 100644 --- a/tests/wpt/web-platform-tests/resources/idlharness.js +++ b/tests/wpt/web-platform-tests/resources/idlharness.js @@ -2393,12 +2393,12 @@ IdlInterface.prototype.test_member_attribute = function(member) } else { promise_rejects_js(a_test, TypeError, this.get_interface_object().prototype[member.name]) - .then(function() { + .then(a_test.step_func(function() { // do_interface_attribute_asserts must be the last // thing we do, since it will call done() on a_test. this.do_interface_attribute_asserts(this.get_interface_object().prototype, member, a_test); - }.bind(this)); + }.bind(this))); } } else { assert_equals(this.get_interface_object().prototype[member.name], undefined, diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-registration-with-type.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-registration-with-type.py index 4f6d5ae2820..3cabc0fb46d 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-registration-with-type.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-registration-with-type.py @@ -1,5 +1,5 @@ def classic_script(): - return """ + return b""" importScripts('./imported-classic-script.js'); self.onmessage = e => { e.source.postMessage(imported); @@ -7,7 +7,7 @@ def classic_script(): """ def module_script(): - return """ + return b""" import * as module from './imported-module-script.js'; self.onmessage = e => { e.source.postMessage(module.imported); @@ -17,17 +17,17 @@ def module_script(): # Returns the classic script for a first request and # returns the module script for second and subsequent requests. def main(request, response): - headers = [('Content-Type', 'application/javascript'), - ('Pragma', 'no-store'), - ('Cache-Control', 'no-store')] + headers = [(b'Content-Type', b'application/javascript'), + (b'Pragma', b'no-store'), + (b'Cache-Control', b'no-store')] - classic_first = request.GET['classic_first'] - key = request.GET['key'] + classic_first = request.GET[b'classic_first'] + key = request.GET[b'key'] requested_once = request.server.stash.take(key) if requested_once is None: request.server.stash.put(key, True) - body = classic_script() if classic_first == '1' else module_script() + body = classic_script() if classic_first == b'1' else module_script() else: - body = module_script() if classic_first == '1' else classic_script() + body = module_script() if classic_first == b'1' else classic_script() return 200, headers, body diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-worker-from-file.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-worker-from-file.py index 7604719c8e0..ac0850f4762 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-worker-from-file.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-worker-from-file.py @@ -1,19 +1,21 @@ import os +from wptserve.utils import isomorphic_encode + def serve_js_from_file(request, response, filename): - body = '' - path = os.path.join(os.path.dirname(__file__), filename) + body = b'' + path = os.path.join(os.path.dirname(isomorphic_encode(__file__)), filename) with open(path, 'rb') as f: body = f.read() return ( [ - ('Cache-Control', 'no-cache, must-revalidate'), - ('Pragma', 'no-cache'), - ('Content-Type', 'application/javascript') + (b'Cache-Control', b'no-cache, must-revalidate'), + (b'Pragma', b'no-cache'), + (b'Content-Type', b'application/javascript') ], body) def main(request, response): - key = request.GET["Key"] + key = request.GET[b"Key"] visited_count = request.server.stash.take(key) if visited_count is None: @@ -25,7 +27,7 @@ def main(request, response): # Serve a file based on how many times it's requested. if visited_count == 1: - return serve_js_from_file(request, response, request.GET["First"]) + return serve_js_from_file(request, response, request.GET[b"First"]) if visited_count == 2: - return serve_js_from_file(request, response, request.GET["Second"]) - raise "Unknown state" + return serve_js_from_file(request, response, request.GET[b"Second"]) + raise u"Unknown state" diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-worker.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-worker.py index d25179304a7..0bf331cb2aa 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-worker.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-worker.py @@ -1,38 +1,40 @@ -import urllib +from six.moves.urllib.parse import unquote + +from wptserve.utils import isomorphic_decode, isomorphic_encode def redirect_response(request, response, visited_count): # |visited_count| is used as a unique id to differentiate responses # every time. - location = 'empty.js' - if 'Redirect' in request.GET: - location = urllib.unquote(request.GET['Redirect']) + location = b'empty.js' + if b'Redirect' in request.GET: + location = isomorphic_encode(unquote(isomorphic_decode(request.GET[b'Redirect']))) return (301, [ - ('Cache-Control', 'no-cache, must-revalidate'), - ('Pragma', 'no-cache'), - ('Content-Type', 'application/javascript'), - ('Location', location), + (b'Cache-Control', b'no-cache, must-revalidate'), + (b'Pragma', b'no-cache'), + (b'Content-Type', b'application/javascript'), + (b'Location', location), ], - '/* %s */' % str(visited_count)) + u'/* %s */' % str(visited_count)) def not_found_response(): - return 404, [('Content-Type', 'text/plain')], "Page not found" + return 404, [(b'Content-Type', b'text/plain')], u"Page not found" def ok_response(request, response, visited_count, - extra_body='', mime_type='application/javascript'): + extra_body=u'', mime_type=b'application/javascript'): # |visited_count| is used as a unique id to differentiate responses # every time. return ( [ - ('Cache-Control', 'no-cache, must-revalidate'), - ('Pragma', 'no-cache'), - ('Content-Type', mime_type) + (b'Cache-Control', b'no-cache, must-revalidate'), + (b'Pragma', b'no-cache'), + (b'Content-Type', mime_type) ], - '/* %s */ %s' % (str(visited_count), extra_body)) + u'/* %s */ %s' % (str(visited_count), extra_body)) def main(request, response): - key = request.GET["Key"] - mode = request.GET["Mode"] + key = request.GET[b"Key"] + mode = request.GET[b"Mode"] visited_count = request.server.stash.take(key) if visited_count is None: @@ -44,17 +46,17 @@ def main(request, response): # Return a response based on |mode| only when it's the second time (== update). if visited_count == 2: - if mode == 'normal': + if mode == b'normal': return ok_response(request, response, visited_count) - if mode == 'bad_mime_type': - return ok_response(request, response, visited_count, mime_type='text/html') - if mode == 'not_found': + if mode == b'bad_mime_type': + return ok_response(request, response, visited_count, mime_type=b'text/html') + if mode == b'not_found': return not_found_response() - if mode == 'redirect': - return redirect_response(request, response, visited_count) - if mode == 'syntax_error': - return ok_response(request, response, visited_count, extra_body='badsyntax(isbad;') - if mode == 'throw_install': - return ok_response(request, response, visited_count, extra_body="addEventListener('install', function(e) { throw new Error('boom'); });") + if mode == b'redirect': + return redirect_response(request, response, visited_count) + if mode == b'syntax_error': + return ok_response(request, response, visited_count, extra_body=u'badsyntax(isbad;') + if mode == b'throw_install': + return ok_response(request, response, visited_count, extra_body=u"addEventListener('install', function(e) { throw new Error('boom'); });") return ok_response(request, response, visited_count) diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update_shell.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update_shell.py index 642e5194140..6e89a3a018a 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update_shell.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update_shell.py @@ -7,24 +7,27 @@ # This registers worker.js as a service worker, and every update check # will return a new response. import os -import sys import time +from six import PY3 + +from wptserve.utils import isomorphic_encode + def main(request, response): # Set no-cache to ensure the user agent finds a new version for each update. - headers = [('Cache-Control', 'no-cache, must-revalidate'), - ('Pragma', 'no-cache'), - ('Content-Type', 'application/javascript')] + headers = [(b'Cache-Control', b'no-cache, must-revalidate'), + (b'Pragma', b'no-cache'), + (b'Content-Type', b'application/javascript')] # Return a different script for each access. Use .time() and .clock() for # best time resolution across different platforms. - timestamp = '// %s %s' % (time.time(), time.clock()) - body = timestamp + '\n' + timestamp = u'// %s %s' % (time.time(), time.perf_counter() if PY3 else time.clock()) + body = isomorphic_encode(timestamp) + b'\n' # Inject the file into the response. - if 'filename' in request.GET: - path = os.path.join(os.path.dirname(__file__), - request.GET['filename']) + if b'filename' in request.GET: + path = os.path.join(os.path.dirname(isomorphic_encode(__file__)), + request.GET[b'filename']) with open(path, 'rb') as f: body += f.read() diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/worker_interception_redirect_webworker.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/worker_interception_redirect_webworker.py index e388e461448..4ed5beea745 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/worker_interception_redirect_webworker.py +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/worker_interception_redirect_webworker.py @@ -2,18 +2,19 @@ # parameter to inject into the JavaScript to indicate how the request # reached the server. import os -import sys + +from wptserve.utils import isomorphic_decode def main(request, response): - path = os.path.join(os.path.dirname(__file__), - "worker-interception-redirect-webworker.js") - body = open(path, "rb").read() - if "greeting" in request.GET: - body = body.replace("%GREETING_TEXT%", request.GET["greeting"]) + path = os.path.join(os.path.dirname(isomorphic_decode(__file__)), + u"worker-interception-redirect-webworker.js") + body = open(path, u"rb").read() + if b"greeting" in request.GET: + body = body.replace(b"%GREETING_TEXT%", request.GET[b"greeting"]) else: - body = body.replace("%GREETING_TEXT%", "") + body = body.replace(b"%GREETING_TEXT%", b"") headers = [] - headers.append(("Content-Type", "text/javascript")) + headers.append((b"Content-Type", b"text/javascript")) return headers, body diff --git a/tests/wpt/web-platform-tests/tools/serve/serve.py b/tests/wpt/web-platform-tests/tools/serve/serve.py index db15ba4833c..74a2ebc3860 100644 --- a/tests/wpt/web-platform-tests/tools/serve/serve.py +++ b/tests/wpt/web-platform-tests/tools/serve/serve.py @@ -514,7 +514,7 @@ def make_hosts_file(config, host): def start_servers(host, ports, paths, routes, bind_address, config, **kwargs): servers = defaultdict(list) for scheme, ports in ports.items(): - assert len(ports) == {"http": 2}.get(scheme, 1) + assert len(ports) == {"http": 2, "https": 2}.get(scheme, 1) # If trying to start HTTP/2.0 server, check compatibility if scheme == 'h2' and not http2_compatible(): @@ -822,7 +822,7 @@ class ConfigBuilder(config.ConfigBuilder): "server_host": None, "ports": { "http": [8000, "auto"], - "https": [8443], + "https": [8443, 8444], "ws": ["auto"], "wss": ["auto"], }, diff --git a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/environment.py b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/environment.py index 3aaeeca6cd3..ad648374af9 100644 --- a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/environment.py +++ b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/environment.py @@ -128,7 +128,7 @@ class TestEnvironment(object): ports = { "http": [8000, 8001], - "https": [8443], + "https": [8443, 8444], "ws": [8888], "wss": [8889], "h2": [9000], diff --git a/tests/wpt/web-platform-tests/ua-client-hints/idlharness.https.any.js b/tests/wpt/web-platform-tests/ua-client-hints/idlharness.https.any.js new file mode 100644 index 00000000000..13a9225b47f --- /dev/null +++ b/tests/wpt/web-platform-tests/ua-client-hints/idlharness.https.any.js @@ -0,0 +1,21 @@ +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js + +'use strict'; + +// https://wicg.github.io/ua-client-hints/ + +idl_test( + ['ua-client-hints'], + ['html', 'dom'], + idl_array => { + if (self.GLOBAL.isWorker()) { + idl_array.add_objects({ WorkerNavigator: ['navigator'] }); + } else { + idl_array.add_objects({ Navigator: ['navigator'] }); + } + idl_array.add_objects({ + NavigatorUAData: ['navigator.userAgentData'], + }); + } +); diff --git a/tests/wpt/web-platform-tests/websockets/cookies/support/set-cookie.py b/tests/wpt/web-platform-tests/websockets/cookies/support/set-cookie.py index 28e34a71525..f373d1341a3 100644 --- a/tests/wpt/web-platform-tests/websockets/cookies/support/set-cookie.py +++ b/tests/wpt/web-platform-tests/websockets/cookies/support/set-cookie.py @@ -1,6 +1,7 @@ from six.moves.urllib import parse +from wptserve.utils import isomorphic_encode def main(request, response): - response.headers.set('Set-Cookie', parse.unquote(request.url_parts.query)) - return [("Content-Type", "text/plain")], "" + response.headers.set(b'Set-Cookie', isomorphic_encode(parse.unquote(request.url_parts.query))) + return [(b"Content-Type", b"text/plain")], b"" diff --git a/tests/wpt/web-platform-tests/websockets/security/check.py b/tests/wpt/web-platform-tests/websockets/security/check.py index f1414376dcf..716b837f494 100644 --- a/tests/wpt/web-platform-tests/websockets/security/check.py +++ b/tests/wpt/web-platform-tests/websockets/security/check.py @@ -1,2 +1,2 @@ def main(request, response): - return "FAIL" if 'Sec-WebSocket-Key' in request.headers else "PASS" + return b"FAIL" if b'Sec-WebSocket-Key' in request.headers else b"PASS"