Update web-platform-tests to revision 0a28ecf697d96db228f8382db0e41f1c54314dad

This commit is contained in:
WPT Sync Bot 2019-04-02 21:51:07 -04:00
parent 1ff56aa84f
commit 52045cb370
106 changed files with 1208 additions and 778 deletions

File diff suppressed because it is too large Load diff

View file

@ -5,9 +5,6 @@
[Descriptor mathcing priority: Stretch has higher priority than weight] [Descriptor mathcing priority: Stretch has higher priority than weight]
expected: FAIL expected: FAIL
[Matching font-weight: '400' should prefer '450 460' over '500']
expected: FAIL
[Matching font-weight: '400' should prefer '500' over '350 399'] [Matching font-weight: '400' should prefer '500' over '350 399']
expected: FAIL expected: FAIL
@ -38,21 +35,12 @@
[Matching font-weight: '500' should prefer '501 550' over '502 560'] [Matching font-weight: '500' should prefer '501 550' over '502 560']
expected: FAIL expected: FAIL
[Matching font-weight: '501' should prefer '502 510' over '503 520']
expected: FAIL
[Matching font-weight: '501' should prefer '503 520' over '500']
expected: FAIL
[Matching font-weight: '399' should prefer '200 300' over '400'] [Matching font-weight: '399' should prefer '200 300' over '400']
expected: FAIL expected: FAIL
[Matching font-weight: '399' should prefer '400' over '450 460'] [Matching font-weight: '399' should prefer '400' over '450 460']
expected: FAIL expected: FAIL
[Matching font-weight: '399' should prefer '450 460' over '500 501']
expected: FAIL
[Matching font-style: 'normal' should prefer 'oblique -50deg -20deg' over 'oblique -40deg -30deg'] [Matching font-style: 'normal' should prefer 'oblique -50deg -20deg' over 'oblique -40deg -30deg']
expected: FAIL expected: FAIL
@ -149,9 +137,6 @@
[Matching font-stretch: '110%' should prefer '50% 80%' over '60% 70%'] [Matching font-stretch: '110%' should prefer '50% 80%' over '60% 70%']
expected: FAIL expected: FAIL
[Matching font-stretch: '90%' should prefer '90% 100%' over '50% 80%']
expected: FAIL
[Matching font-stretch: '90%' should prefer '50% 80%' over '60% 70%'] [Matching font-stretch: '90%' should prefer '50% 80%' over '60% 70%']
expected: FAIL expected: FAIL
@ -296,9 +281,36 @@
[Matching font-weight: '501' should prefer '501' over '502 510'] [Matching font-weight: '501' should prefer '501' over '502 510']
expected: FAIL expected: FAIL
[Matching font-style: 'oblique 20deg' should prefer 'oblique 40deg 50deg' over 'oblique 10deg']
expected: FAIL
[Matching font-style: 'italic' should prefer 'oblique 30deg 60deg' over 'oblique 40deg 50deg'] [Matching font-style: 'italic' should prefer 'oblique 30deg 60deg' over 'oblique 40deg 50deg']
expected: FAIL expected: FAIL
[Matching font-style: 'italic' should prefer 'oblique 5deg' over 'normal']
expected: FAIL
[Matching font-style: 'oblique 20deg' should prefer 'oblique 20deg' over 'oblique 30deg 60deg']
expected: FAIL
[Matching font-style: 'oblique -10deg' should prefer 'oblique -60deg -30deg' over 'oblique -50deg -40deg']
expected: FAIL
[Matching font-style: 'normal' should prefer 'oblique 10deg 40deg' over 'oblique 20deg 30deg']
expected: FAIL
[Matching font-stretch: '100%' should prefer '110% 120%' over '115% 116%']
expected: FAIL
[Matching font-weight: '501' should prefer '450 460' over '390 410']
expected: FAIL
[Matching font-style: 'oblique -21deg' should prefer 'oblique -10deg' over 'italic']
expected: FAIL
[Matching font-style: 'oblique 21deg' should prefer 'oblique 0deg' over 'oblique -50deg -20deg']
expected: FAIL
[Matching font-style: 'oblique -10deg' should prefer 'oblique -1deg 0deg' over 'oblique -20deg -15deg']
expected: FAIL
[Matching font-style: 'oblique 0deg' should prefer 'italic' over 'oblique -50deg -20deg']
expected: FAIL

View file

@ -74,3 +74,6 @@
[opacity end] [opacity end]
expected: FAIL expected: FAIL
[outline-width end]
expected: FAIL

View file

@ -1,5 +1,5 @@
[elementsFromPoint-iframes.html] [elementsFromPoint-iframes.html]
expected: TIMEOUT expected: CRASH
[elementsFromPoint on the root document for points in iframe elements] [elementsFromPoint on the root document for points in iframe elements]
expected: FAIL expected: FAIL

View file

@ -1,7 +1,7 @@
[response.window.html] [response.window.html]
expected: TIMEOUT expected: TIMEOUT
[fetch(): combined response Content-Type: text/plain ] [fetch(): combined response Content-Type: text/plain ]
expected: FAIL expected: NOTRUN
[Response: combined response Content-Type: text/plain;charset=gbk text/plain;charset=windows-1252] [Response: combined response Content-Type: text/plain;charset=gbk text/plain;charset=windows-1252]
expected: NOTRUN expected: NOTRUN
@ -22,7 +22,7 @@
expected: NOTRUN expected: NOTRUN
[<iframe>: combined response Content-Type: text/plain */*;charset=gbk] [<iframe>: combined response Content-Type: text/plain */*;charset=gbk]
expected: FAIL expected: TIMEOUT
[fetch(): separate response Content-Type: text/html;x=" text/plain] [fetch(): separate response Content-Type: text/html;x=" text/plain]
expected: NOTRUN expected: NOTRUN
@ -64,7 +64,7 @@
expected: NOTRUN expected: NOTRUN
[fetch(): combined response Content-Type: text/html text/plain] [fetch(): combined response Content-Type: text/html text/plain]
expected: FAIL expected: NOTRUN
[Request: combined response Content-Type: text/html;charset=gbk text/plain text/html] [Request: combined response Content-Type: text/html;charset=gbk text/plain text/html]
expected: NOTRUN expected: NOTRUN
@ -76,19 +76,19 @@
expected: NOTRUN expected: NOTRUN
[Response: combined response Content-Type: text/plain ] [Response: combined response Content-Type: text/plain ]
expected: FAIL expected: NOTRUN
[fetch(): combined response Content-Type: text/plain;charset=gbk text/plain] [fetch(): combined response Content-Type: text/plain;charset=gbk text/plain]
expected: NOTRUN expected: NOTRUN
[Request: combined response Content-Type: text/html text/plain] [Request: combined response Content-Type: text/html text/plain]
expected: FAIL expected: NOTRUN
[<iframe>: separate response Content-Type: text/plain */*] [<iframe>: separate response Content-Type: text/plain */*]
expected: FAIL expected: TIMEOUT
[<iframe>: combined response Content-Type: text/plain;charset=gbk text/html;charset=windows-1254] [<iframe>: combined response Content-Type: text/plain;charset=gbk text/html;charset=windows-1254]
expected: FAIL expected: TIMEOUT
[Request: combined response Content-Type: text/plain */*] [Request: combined response Content-Type: text/plain */*]
expected: NOTRUN expected: NOTRUN
@ -118,13 +118,13 @@
expected: NOTRUN expected: NOTRUN
[Response: combined response Content-Type: text/html text/plain] [Response: combined response Content-Type: text/html text/plain]
expected: TIMEOUT expected: NOTRUN
[fetch(): separate response Content-Type: text/plain ] [fetch(): separate response Content-Type: text/plain ]
expected: FAIL expected: TIMEOUT
[<iframe>: combined response Content-Type: text/plain;charset=gbk text/plain] [<iframe>: combined response Content-Type: text/plain;charset=gbk text/plain]
expected: FAIL expected: TIMEOUT
[fetch(): combined response Content-Type: text/html;" \\" text/plain] [fetch(): combined response Content-Type: text/html;" \\" text/plain]
expected: NOTRUN expected: NOTRUN
@ -142,7 +142,7 @@
expected: NOTRUN expected: NOTRUN
[<iframe>: separate response Content-Type: text/plain;charset=gbk text/plain] [<iframe>: separate response Content-Type: text/plain;charset=gbk text/plain]
expected: FAIL expected: TIMEOUT
[Response: combined response Content-Type: text/plain] [Response: combined response Content-Type: text/plain]
expected: FAIL expected: FAIL
@ -163,7 +163,7 @@
expected: NOTRUN expected: NOTRUN
[<iframe>: combined response Content-Type: text/html;" " text/plain] [<iframe>: combined response Content-Type: text/html;" " text/plain]
expected: FAIL expected: TIMEOUT
[Request: combined response Content-Type: text/plain;charset=gbk;x=foo text/plain] [Request: combined response Content-Type: text/plain;charset=gbk;x=foo text/plain]
expected: NOTRUN expected: NOTRUN
@ -172,13 +172,13 @@
expected: NOTRUN expected: NOTRUN
[<iframe>: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK] [<iframe>: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK]
expected: FAIL expected: TIMEOUT
[Response: combined response Content-Type: text/html;x=" text/plain] [Response: combined response Content-Type: text/html;x=" text/plain]
expected: NOTRUN expected: NOTRUN
[<iframe>: combined response Content-Type: text/html;charset=gbk text/html;x=",text/plain] [<iframe>: combined response Content-Type: text/html;charset=gbk text/html;x=",text/plain]
expected: FAIL expected: TIMEOUT
[fetch(): separate response Content-Type: text/plain;charset=gbk text/plain] [fetch(): separate response Content-Type: text/plain;charset=gbk text/plain]
expected: NOTRUN expected: NOTRUN
@ -202,7 +202,7 @@
expected: NOTRUN expected: NOTRUN
[<iframe>: separate response Content-Type: text/html;" " text/plain] [<iframe>: separate response Content-Type: text/html;" " text/plain]
expected: FAIL expected: TIMEOUT
[fetch(): separate response Content-Type: text/plain */*;charset=gbk] [fetch(): separate response Content-Type: text/plain */*;charset=gbk]
expected: NOTRUN expected: NOTRUN
@ -214,7 +214,7 @@
expected: NOTRUN expected: NOTRUN
[<iframe>: combined response Content-Type: text/plain;charset=gbk;x=foo text/plain] [<iframe>: combined response Content-Type: text/plain;charset=gbk;x=foo text/plain]
expected: FAIL expected: TIMEOUT
[Request: combined response Content-Type: text/plain;charset=gbk text/html] [Request: combined response Content-Type: text/plain;charset=gbk text/html]
expected: NOTRUN expected: NOTRUN
@ -238,10 +238,10 @@
expected: NOTRUN expected: NOTRUN
[<iframe>: separate response Content-Type: text/plain;charset=gbk;x=foo text/plain] [<iframe>: separate response Content-Type: text/plain;charset=gbk;x=foo text/plain]
expected: FAIL expected: TIMEOUT
[Request: combined response Content-Type: text/plain ] [Request: combined response Content-Type: text/plain ]
expected: FAIL expected: NOTRUN
[Response: combined response Content-Type: text/html */*;charset=gbk] [Response: combined response Content-Type: text/html */*;charset=gbk]
expected: NOTRUN expected: NOTRUN
@ -259,7 +259,7 @@
expected: NOTRUN expected: NOTRUN
[<iframe>: separate response Content-Type: text/html;charset=gbk text/html;x=",text/plain] [<iframe>: separate response Content-Type: text/html;charset=gbk text/html;x=",text/plain]
expected: FAIL expected: TIMEOUT
[fetch(): separate response Content-Type: text/plain;charset=gbk text/html;charset=windows-1254] [fetch(): separate response Content-Type: text/plain;charset=gbk text/html;charset=windows-1254]
expected: NOTRUN expected: NOTRUN
@ -277,16 +277,16 @@
expected: NOTRUN expected: NOTRUN
[<iframe>: combined response Content-Type: text/plain */*] [<iframe>: combined response Content-Type: text/plain */*]
expected: FAIL expected: TIMEOUT
[fetch(): separate response Content-Type: text/html text/plain] [fetch(): separate response Content-Type: text/html text/plain]
expected: FAIL expected: NOTRUN
[Request: combined response Content-Type: text/html;" text/plain] [Request: combined response Content-Type: text/html;" text/plain]
expected: NOTRUN expected: NOTRUN
[<iframe>: separate response Content-Type: text/html;" \\" text/plain ";charset=GBK] [<iframe>: separate response Content-Type: text/html;" \\" text/plain ";charset=GBK]
expected: FAIL expected: TIMEOUT
[fetch(): combined response Content-Type: text/html;" " text/plain] [fetch(): combined response Content-Type: text/html;" " text/plain]
expected: NOTRUN expected: NOTRUN
@ -295,7 +295,7 @@
expected: NOTRUN expected: NOTRUN
[<iframe>: separate response Content-Type: text/plain;charset=gbk text/plain;charset=windows-1252] [<iframe>: separate response Content-Type: text/plain;charset=gbk text/plain;charset=windows-1252]
expected: FAIL expected: TIMEOUT
[Response: combined response Content-Type: text/plain */*;charset=gbk] [Response: combined response Content-Type: text/plain */*;charset=gbk]
expected: NOTRUN expected: NOTRUN
@ -310,8 +310,47 @@
expected: NOTRUN expected: NOTRUN
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk] [<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
expected: FAIL expected: TIMEOUT
[<iframe>: separate response Content-Type: text/html;" text/plain] [<iframe>: separate response Content-Type: text/html;" text/plain]
expected: FAIL expected: TIMEOUT
[<iframe>: combined response Content-Type: text/html;" text/plain]
expected: TIMEOUT
[<iframe>: combined response Content-Type: */* text/html]
expected: TIMEOUT
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
expected: TIMEOUT
[<iframe>: combined response Content-Type: text/html */*]
expected: TIMEOUT
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
expected: TIMEOUT
[<iframe>: separate response Content-Type: text/html */*]
expected: TIMEOUT
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: TIMEOUT
[<iframe>: separate response Content-Type: text/html;charset=gbk text/plain text/html]
expected: TIMEOUT
[<iframe>: separate response Content-Type: */* text/html]
expected: TIMEOUT
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: TIMEOUT
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: TIMEOUT
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
expected: TIMEOUT
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: TIMEOUT

View file

@ -0,0 +1,5 @@
[javascript-url-abort-return-value-undefined.tentative.html]
expected: TIMEOUT
[Not aborting fetch for javascript:undefined navigation]
expected: TIMEOUT

View file

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

View file

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

View file

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

View file

@ -1,5 +1,4 @@
[closed-attribute.window.html] [closed-attribute.window.html]
expected: CRASH
[closed and cross-site nested browsing context] [closed and cross-site nested browsing context]
expected: FAIL expected: FAIL

View file

@ -0,0 +1,4 @@
[loop-from-ended.tentative.html]
[Test looping edge case to verify http://crbug.com/364442.]
expected: FAIL

View file

@ -1,2 +0,0 @@
[script-onerror-insertion-point-2.html]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
[iframe_005.html]
[document.write external script into iframe write back into parent]
expected: FAIL

View file

@ -1,5 +1,4 @@
[005.html] [005.html]
expected: ERROR
[dedicated worker in shared worker in dedicated worker] [dedicated worker in shared worker in dedicated worker]
expected: FAIL expected: FAIL

View file

@ -1,2 +0,0 @@
[transition_calc_implicit.html]
expected: TIMEOUT

View file

@ -1,16 +1,10 @@
workflow "Build & Release Manifest" { workflow "Build & Release Manifest" {
on = "push" on = "push"
resolves = ["tag-master"] resolves = ["manifest-build-and-tag"]
} }
action "build-manifest" { action "manifest-build-and-tag" {
uses = "./tools/docker/github" uses = "./tools/docker/github"
runs = ["bash", "-c", "tools/ci/action_manifest_build.sh"] runs = ["python", "tools/ci/manifest_build.py"]
}
action "tag-master" {
needs = "build-manifest"
uses = "./tools/docker/github"
runs = ["python", "tools/ci/tag_master.py"]
secrets = ["GITHUB_TOKEN"] secrets = ["GITHUB_TOKEN"]
} }

View file

@ -198,14 +198,22 @@ tasks:
- name: lint - name: lint
description: >- description: >-
Lint for wpt-specific requirements Lint for wpt-specific requirements
script: ./tools/ci/run_tc.py --no-hosts lint tools/ci/ci_lint.sh script: >-
./tools/ci/run_tc.py \
--no-hosts \
lint \
./wpt lint --all
conditions: conditions:
push push
pull-request pull-request
- name: update built tests - name: update built tests
description: >- description: >-
Ensure test suites that require a build step are updated Ensure test suites that require a build step are updated
script: ./tools/ci/run_tc.py --no-hosts update_built tools/ci/ci_built_diff.sh script: >-
./tools/ci/run_tc.py \
--no-hosts \
update_built \
tools/ci/ci_built_diff.sh
conditions: conditions:
pull-request pull-request
- name: tools/ unittests (Python 2) - name: tools/ unittests (Python 2)

View file

@ -0,0 +1,18 @@
import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource
def generate_payload(request, server_data):
file = os.path.join(request.doc_root, "webaudio", "resources",
"sin_440Hz_-6dBFS_1s.wav")
return open(file, "rb").read()
def main(request, response):
handler = lambda data: generate_payload(request, data)
subresource.respond(request,
response,
payload_generator = handler,
access_control_allow_origin = "*",
content_type = "audio/wav")

View file

@ -1,6 +1,5 @@
import os, json, sys import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource import subresource
def generate_payload(server_data): def generate_payload(server_data):

View file

@ -0,0 +1,14 @@
import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource
def generate_payload(server_data):
return ''
def main(request, response):
subresource.respond(request,
response,
payload_generator = generate_payload,
access_control_allow_origin = "*",
content_type = "text/plain")

View file

@ -1,4 +1,4 @@
import os, sys, json, base64 import os, sys, base64
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource import subresource

View file

@ -1,4 +1,4 @@
import os, sys, array, json, math, StringIO import os, sys, array, math, StringIO
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource import subresource

View file

@ -1,4 +1,4 @@
import os, sys, json import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource import subresource

View file

@ -1,4 +1,4 @@
import os, sys, json import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource import subresource

View file

@ -1,4 +1,4 @@
import os, sys, json import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource import subresource
@ -23,23 +23,9 @@ def generate_payload(request, server_data):
"property": request.GET["property"]} "property": request.GET["property"]}
def generate_import_rule(request, server_data): def generate_import_rule(request, server_data):
type = 'image' return "@import url('%(url)s');" % {
property = None; "url": subresource.create_url(request, swap_origin=True,
if "type" in request.GET: query_parameter_to_remove="import-rule")
type = request.GET["type"]
if type == "svg" and "property" in request.GET:
property = request.GET["property"]
if property is None:
return "@import url('%(url)s?id=%(id)s&type=%(type)s');" % {
"id": request.GET["id"],
"url": subresource.create_redirect_url(request, cross_origin = True),
"type": type
}
return "@import url('%(url)s?id=%(id)s&type=%(type)s&property=%(property)s');" % {
"id": request.GET["id"],
"url": subresource.create_redirect_url(request, cross_origin = True),
"type": type,
"property": property
} }
def generate_report_headers_payload(request, server_data): def generate_report_headers_payload(request, server_data):

View file

@ -1,38 +1,14 @@
import os, sys, json, urlparse, urllib import os, json, urllib, urlparse
def get_template(template_basename): def get_template(template_basename):
script_directory = os.path.dirname(os.path.abspath(__file__)) script_directory = os.path.dirname(os.path.abspath(__file__))
template_directory = os.path.abspath(os.path.join(script_directory, template_directory = os.path.abspath(os.path.join(script_directory,
"..",
"template")) "template"))
template_filename = os.path.join(template_directory, template_basename); template_filename = os.path.join(template_directory, template_basename);
with open(template_filename, "r") as f: with open(template_filename, "r") as f:
return f.read() return f.read()
# TODO(kristijanburnik): subdomain_prefix is a hardcoded value aligned with
# referrer-policy-test-case.js. The prefix should be configured in one place.
def get_swapped_origin_netloc(netloc, subdomain_prefix = "www1."):
if netloc.startswith(subdomain_prefix):
return netloc[len(subdomain_prefix):]
else:
return subdomain_prefix + netloc
def create_redirect_url(request, cross_origin = False):
parsed = urlparse.urlsplit(request.url)
destination_netloc = parsed.netloc
if cross_origin:
destination_netloc = get_swapped_origin_netloc(parsed.netloc)
destination_url = urlparse.urlunsplit(urlparse.SplitResult(
scheme = parsed.scheme,
netloc = destination_netloc,
path = parsed.path,
query = None,
fragment = None))
return destination_url
def redirect(url, response): def redirect(url, response):
response.add_required_headers = False response.add_required_headers = False
@ -43,6 +19,50 @@ def redirect(url, response):
response.writer.write("") response.writer.write("")
# TODO(kristijanburnik): subdomain_prefix is a hardcoded value aligned with
# referrer-policy-test-case.js. The prefix should be configured in one place.
def __get_swapped_origin_netloc(netloc, subdomain_prefix = "www1."):
if netloc.startswith(subdomain_prefix):
return netloc[len(subdomain_prefix):]
else:
return subdomain_prefix + netloc
# Creates a URL (typically a redirect target URL) that is the same as the
# current request URL `request.url`, except for:
# - When `swap_scheme` or `swap_origin` is True, its scheme/origin is changed
# to the other one. (http <-> https, ws <-> wss, etc.)
# - `query_parameter_to_remove` parameter is removed from query part.
# Its default is "redirection" to avoid redirect loops.
def create_url(request, swap_scheme = False, swap_origin = False,
query_parameter_to_remove = "redirection"):
parsed = urlparse.urlsplit(request.url)
destination_netloc = parsed.netloc
scheme = parsed.scheme
if swap_scheme:
scheme = "http" if parsed.scheme == "https" else "https"
hostname = parsed.netloc.split(':')[0]
port = request.server.config["ports"][scheme][0]
destination_netloc = ":".join([hostname, str(port)])
if swap_origin:
destination_netloc = __get_swapped_origin_netloc(destination_netloc)
parsed_query = urlparse.parse_qsl(parsed.query, keep_blank_values=True)
parsed_query = filter(lambda x: x[0] != query_parameter_to_remove,
parsed_query)
destination_url = urlparse.urlunsplit(urlparse.SplitResult(
scheme = scheme,
netloc = destination_netloc,
path = parsed.path,
query = urllib.urlencode(parsed_query),
fragment = None))
return destination_url
def preprocess_redirection(request, response): def preprocess_redirection(request, response):
if "redirection" not in request.GET: if "redirection" not in request.GET:
return False return False
@ -51,10 +71,14 @@ def preprocess_redirection(request, response):
if redirection == "no-redirect": if redirection == "no-redirect":
return False return False
elif redirection == "keep-scheme-redirect":
redirect_url = create_url(request, swap_scheme=False)
elif redirection == "swap-scheme-redirect":
redirect_url = create_url(request, swap_scheme=True)
elif redirection == "keep-origin-redirect": elif redirection == "keep-origin-redirect":
redirect_url = create_redirect_url(request, cross_origin = False) redirect_url = create_url(request, swap_origin=False)
elif redirection == "swap-origin-redirect": elif redirection == "swap-origin-redirect":
redirect_url = create_redirect_url(request, cross_origin = True) redirect_url = create_url(request, swap_origin=True)
else: else:
raise ValueError("Invalid redirection type '%s'" % redirection) raise ValueError("Invalid redirection type '%s'" % redirection)
@ -62,6 +86,43 @@ def preprocess_redirection(request, response):
return True return True
def preprocess_stash_action(request, response):
if "action" not in request.GET:
return False
action = request.GET["action"]
key = request.GET["key"]
stash = request.server.stash
path = request.GET.get("path", request.url.split('?'))[0]
if action == "put":
value = request.GET["value"]
stash.take(key=key, path=path)
stash.put(key=key, value=value, path=path)
response_data = json.dumps({"status": "success", "result": key})
elif action == "purge":
value = stash.take(key=key, path=path)
return False
elif action == "take":
value = stash.take(key=key, path=path)
if value is None:
status = "allowed"
else:
status = "blocked"
response_data = json.dumps({"status": status, "result": value})
else:
return False
response.add_required_headers = False
response.writer.write_status(200)
response.writer.write_header("content-type", "text/javascript")
response.writer.write_header("cache-control", "no-cache; must-revalidate")
response.writer.end_headers()
response.writer.write(response_data)
return True
def __noop(request, response): def __noop(request, response):
return "" return ""
@ -77,6 +138,9 @@ def respond(request,
if preprocess_redirection(request, response): if preprocess_redirection(request, response):
return return
if preprocess_stash_action(request, response):
return
response.add_required_headers = False response.add_required_headers = False
response.writer.write_status(status_code) response.writer.write_status(status_code)

View file

@ -1,4 +1,4 @@
import os, sys, json import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource import subresource

View file

@ -2,7 +2,7 @@
font-family: 'wpt'; font-family: 'wpt';
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
src: url(/referrer-policy/generic/subresource/font.py?id=%(id)s) format('truetype'); src: url(/common/security-features/subresource/font.py?id=%(id)s) format('truetype');
} }
body { body {
font-family: 'wpt'; font-family: 'wpt';

View file

@ -0,0 +1,3 @@
div.styled::before {
content:url(/common/security-features/subresource/image.py?id=%(id)s)
}

View file

@ -0,0 +1,3 @@
path {
%(property)s: url(/common/security-features/subresource/svg.py?id=%(id)s#invalidFragment);
}

View file

@ -0,0 +1,17 @@
import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource
def generate_payload(request, server_data):
file = os.path.join(request.doc_root, "media", "movie_5.ogv")
return open(file, "rb").read()
def main(request, response):
handler = lambda data: generate_payload(request, data)
subresource.respond(request,
response,
payload_generator = handler,
access_control_allow_origin = "*",
content_type = "video/ogg")

View file

@ -1,4 +1,4 @@
import os, sys, json import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource import subresource

View file

@ -1,4 +1,4 @@
import os, sys, json import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import subresource import subresource

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<title>Tests that scrollbars are handled correctly in a flex item with contains:size</title>
<link rel="author" title="Google LLC" href="https://www.google.com">
<link rel="help" href="https://www.w3.org/TR/css-contain-1/#containment-size">
<link rel="match" href="reference/contain-size-flexbox-002-ref.html">
<style>
div > div {
vertical-align: top;
display: inline-block;
contain: size;
overflow: scroll;
border: 1px solid;
}
</style>
<p>Test passes if the two lines below look the same.</p>
<div style="display: flex; line-height: 1.0;">
<div></div>
</div>
<div style="line-height: 1.0;">
<div></div>
</div>

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<title>Tests that scrollbars are handled correctly in a flex item with contains:size</title>
<link rel="author" title="Google LLC" href="https://www.google.com">
<style>
div > div {
vertical-align: top;
display: inline-block;
contain: size;
overflow: scroll;
border: 1px solid;
}
</style>
<p>Test passes if the two lines below look the same.</p>
<div style="line-height: 1.0;">
<div></div>
</div>
<div style="line-height: 1.0;">
<div></div>
</div>

View file

@ -0,0 +1,22 @@
<!doctype HTML>
<title>CSS Reference</title>
<style>
table {
border-collapse: collapse;
}
td {
border: 1px solid red;
}
</style>
<table>
<tr>
<td id=target rowspan="2">
Needs border
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>

View file

@ -0,0 +1,26 @@
<!doctype HTML>
<title>CSS Test: collapsed borders of row-spanning cells should paint correctly.</title>
<link rel="author" title="Chris Harrelson" href="chrishtr@chromium.org">
<link rel="match" href="border-collapse-rowspan-cell-ref.html">
<link rel="help" href="https://drafts.csswg.org/css-tables/#slot">
<style>
table {
border-collapse: collapse;
}
td {
border: 1px solid red;
position: relative;
}
</style>
<table>
<tr>
<td rowspan="2">
Needs border
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>

View file

@ -19,6 +19,7 @@
// MIME-types not protected by CORB // MIME-types not protected by CORB
"image/gif", "image/png", "image/png;blah", "image/svg+xml", "image/gif", "image/png", "image/png;blah", "image/svg+xml",
"application/javascript", "application/jsonp", "application/javascript", "application/jsonp",
"application/dash+xml", // video format
"image/gif;HI=THERE", "image/gif;HI=THERE",
// MIME types that may seem to be JSON or XML, but really aren't - i.e. // MIME types that may seem to be JSON or XML, but really aren't - i.e.

View file

@ -9,7 +9,7 @@
// encode their request headers in their pixels. Fun stuff! // encode their request headers in their pixels. Fun stuff!
promise_test(() => promise_test(() =>
loadImageInWindow( loadImageInWindow(
"https://{{host}}:{{ports[https][0]}}/referrer-policy/generic/subresource/image.py", "https://{{host}}:{{ports[https][0]}}/common/security-features/subresource/image.py",
[], [],
window) window)
.then(img => { .then(img => {
@ -33,7 +33,7 @@
promise_test(() => promise_test(() =>
loadImageInWindow( loadImageInWindow(
"https://{{hosts[][www]}}:{{ports[https][0]}}/referrer-policy/generic/subresource/image.py", "https://{{hosts[][www]}}:{{ports[https][0]}}/common/security-features/subresource/image.py",
[], [],
window) window)
.then(img => { .then(img => {
@ -57,7 +57,7 @@
promise_test(() => promise_test(() =>
loadImageInWindow( loadImageInWindow(
"https://{{hosts[alt][www]}}:{{ports[https][0]}}/referrer-policy/generic/subresource/image.py", "https://{{hosts[alt][www]}}:{{ports[https][0]}}/common/security-features/subresource/image.py",
[], [],
window) window)
.then(img => { .then(img => {

View file

@ -0,0 +1,55 @@
<!DOCTYPE html>
<title>Test looping edge case to verify http://crbug.com/364442.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/media.js"></script>
<video></video>
<script>
// Seek towards end of video (for faster testing).
// Play video to end with "loop" set to false.
// Once ended, set "loop" to true. Call play.
// Verify that "seeked" event fires, seeking back to the beginning.
// Pause video and end test.
async_test(function(t) {
var video = document.querySelector("video");
video.onloadedmetadata = t.step_func(function() {
// Video is initially paused and "loop" unset.
assert_true(video.paused, "paused initially ");
assert_false(video.loop, "loop initially");
// Seek to just before the end of the video and play.
video.currentTime = video.duration - 0.5;
video.onended = t.step_func(function() {
// Verify played to end and stopped.
assert_true(video.ended, "ended at ended event");
assert_true(video.paused, "paused at ended event");
assert_equals(video.currentTime, video.duration, "currentTime at ended event");
// With playback ended, set "loop" attribute. This will cause ended == false.
// looping video cannot be "ended", only paused.
assert_false(video.loop, "loop at ended event");
video.loop = true;
assert_true(video.loop, "loop after seek");
assert_false(video.ended, "ended after seek");
assert_true(video.paused, "paused after seek");
video.onseeked = t.step_func_done(function() {
// Observed seek. Verify current time decreased and still playing.
assert_true(video.loop, "loop at seeked event")
assert_false(video.paused, "paused at seeked event");
assert_false(video.ended, "ended at seeked event");
assert_less_than(video.currentTime, video.duration, "currentTime at seeked event");
// Pausing now that test is over to prevent additional unwanted looping.
video.pause();
});
// Play video with "loop" set. Expect seek back to start.
video.play();
});
video.play();
});
video.src = getVideoURI("/media/movie_5");
});
</script>

View file

@ -11,6 +11,7 @@ enum WakeLockType { "screen", "system" };
[Constructor(WakeLockType type), SecureContext, Exposed=(DedicatedWorker,Window)] [Constructor(WakeLockType type), SecureContext, Exposed=(DedicatedWorker,Window)]
interface WakeLock : EventTarget { interface WakeLock : EventTarget {
[Exposed=Window] static Promise<PermissionState> requestPermission(WakeLockType type);
readonly attribute WakeLockType type; readonly attribute WakeLockType type;
readonly attribute boolean active; readonly attribute boolean active;
attribute EventHandler onactivechange; attribute EventHandler onactivechange;

View file

@ -149,8 +149,7 @@ interface XRRigidTransform {
readonly attribute DOMPointReadOnly position; readonly attribute DOMPointReadOnly position;
readonly attribute DOMPointReadOnly orientation; readonly attribute DOMPointReadOnly orientation;
readonly attribute Float32Array matrix; readonly attribute Float32Array matrix;
readonly attribute XRRigidTransform inverse;
XRRigidTransform inverse();
}; };
[SecureContext, Exposed=Window, [SecureContext, Exposed=Window,

View file

@ -1,106 +0,0 @@
import json, os, urllib, urlparse
def redirect(url, response):
response.add_required_headers = False
response.writer.write_status(301)
response.writer.write_header("access-control-allow-origin", "*")
response.writer.write_header("location", url)
response.writer.end_headers()
response.writer.write("")
def create_redirect_url(request, swap_scheme = False):
parsed = urlparse.urlsplit(request.url)
destination_netloc = parsed.netloc
scheme = parsed.scheme
if swap_scheme:
scheme = "http" if parsed.scheme == "https" else "https"
hostname = parsed.netloc.split(':')[0]
port = request.server.config["ports"][scheme][0]
destination_netloc = ":".join([hostname, str(port)])
# Remove "redirection" from query to avoid redirect loops.
parsed_query = dict(urlparse.parse_qsl(parsed.query))
assert "redirection" in parsed_query
del parsed_query["redirection"]
destination_url = urlparse.urlunsplit(urlparse.SplitResult(
scheme = scheme,
netloc = destination_netloc,
path = parsed.path,
query = urllib.urlencode(parsed_query),
fragment = None))
return destination_url
def main(request, response):
if "redirection" in request.GET:
redirection = request.GET["redirection"]
if redirection == "no-redirect":
pass
elif redirection == "keep-scheme-redirect":
redirect(create_redirect_url(request, swap_scheme=False), response)
return
elif redirection == "swap-scheme-redirect":
redirect(create_redirect_url(request, swap_scheme=True), response)
return
else:
raise ValueError ("Invalid redirect type: %s" % redirection)
content_type = "text/plain"
response_data = ""
if "action" in request.GET:
action = request.GET["action"]
if "content_type" in request.GET:
content_type = request.GET["content_type"]
key = request.GET["key"]
stash = request.server.stash
path = request.GET.get("path", request.url.split('?'))[0]
if action == "put":
value = request.GET["value"]
stash.take(key=key, path=path)
stash.put(key=key, value=value, path=path)
response_data = json.dumps({"status": "success", "result": key})
elif action == "purge":
value = stash.take(key=key, path=path)
if content_type == "image/png":
response_data = open(os.path.join(request.doc_root,
"images",
"smiley.png"), "rb").read()
elif content_type == "audio/wav":
response_data = open(os.path.join(request.doc_root,
"webaudio", "resources", "sin_440Hz_-6dBFS_1s.wav"), "rb").read()
elif content_type == "video/ogg":
response_data = open(os.path.join(request.doc_root,
"media",
"movie_5.ogv"), "rb").read()
elif content_type == "application/javascript":
response_data = open(os.path.join(request.doc_root,
"mixed-content",
"generic",
"worker.js"), "rb").read()
elif content_type == "text/javascript":
response_data = open(os.path.join(request.doc_root,
"mixed-content",
"generic",
"script.js"), "rb").read()
else:
response_data = "/* purged */"
elif action == "take":
value = stash.take(key=key, path=path)
if value is None:
status = "allowed"
else:
status = "blocked"
response_data = json.dumps({"status": status, "result": value})
response.add_required_headers = False
response.writer.write_status(200)
response.writer.write_header("content-type", content_type)
response.writer.write_header("cache-control", "no-cache; must-revalidate")
response.writer.end_headers()
response.writer.write(response_data)

View file

@ -21,43 +21,33 @@ function wrapResult(server_data) {
* @return {object} Object wrapping the start method used to run the test. * @return {object} Object wrapping the start method used to run the test.
*/ */
function MixedContentTestCase(scenario, description, sanityChecker) { function MixedContentTestCase(scenario, description, sanityChecker) {
var httpProtocol = "http"; const subresourcePath = {
var httpsProtocol = "https"; "a-tag": "/common/security-features/subresource/document.py",
var wsProtocol = "ws"; "area-tag": "/common/security-features/subresource/document.py",
var wssProtocol = "wss"; "beacon-request": "/common/security-features/subresource/empty.py",
"fetch-request": "/common/security-features/subresource/xhr.py",
"form-tag": "/common/security-features/subresource/empty.py",
"iframe-tag": "/common/security-features/subresource/document.py",
"img-tag": "/common/security-features/subresource/image.py",
"picture-tag": "/common/security-features/subresource/image.py",
"script-tag": "/common/security-features/subresource/script.py",
var sameOriginHost = location.hostname; "worker-request": "/common/security-features/subresource/worker.py",
var crossOriginHost = "{{domains[www1]}}"; "module-worker-top-level": "/common/security-features/subresource/worker.py",
"module-data-worker-import": "/common/security-features/subresource/worker.py",
// These values can evaluate to either empty strings or a ":port" string. "object-tag": "/common/security-features/subresource/empty.py",
var httpPort = getNormalizedPort(parseInt("{{ports[http][0]}}", 10));
var httpsPort = getNormalizedPort(parseInt("{{ports[https][0]}}", 10));
var wsPort = getNormalizedPort(parseInt("{{ports[ws][0]}}", 10));
var wssPort = getNormalizedPort(parseInt("{{ports[wss][0]}}", 10));
var resourcePath = "/mixed-content/generic/expect.py"; "link-css-tag": "/common/security-features/subresource/empty.py",
var wsResourcePath = "/stash_responder"; "link-prefetch-tag": "/common/security-features/subresource/empty.py",
"classic-data-worker-fetch": "/common/security-features/subresource/empty.py",
// Map all endpoints to scenario for use in the test. "xhr-request": "/common/security-features/subresource/xhr.py",
var endpoint = {
"same-origin": "audio-tag": "/common/security-features/subresource/audio.py",
location.origin + resourcePath, "video-tag": "/common/security-features/subresource/video.py",
"same-host-https":
httpsProtocol + "://" + sameOriginHost + httpsPort + resourcePath, "websocket-request": "/stash_responder"
"same-host-http":
httpProtocol + "://" + sameOriginHost + httpPort + resourcePath,
"cross-origin-https":
httpsProtocol + "://" + crossOriginHost + httpsPort + resourcePath,
"cross-origin-http":
httpProtocol + "://" + crossOriginHost + httpPort + resourcePath,
"same-host-wss":
wssProtocol + "://" + sameOriginHost + wssPort + wsResourcePath,
"same-host-ws":
wsProtocol + "://" + sameOriginHost + wsPort + wsResourcePath,
"cross-origin-wss":
wssProtocol + "://" + crossOriginHost + wssPort + wsResourcePath,
"cross-origin-ws":
wsProtocol + "://" + crossOriginHost + wsPort + wsResourcePath
}; };
// Mapping all the resource requesting methods to the scenario. // Mapping all the resource requesting methods to the scenario.
@ -88,44 +78,56 @@ function MixedContentTestCase(scenario, description, sanityChecker) {
"websocket-request": requestViaWebSocket "websocket-request": requestViaWebSocket
}; };
// Mapping all expected MIME types to the scenario.
var contentType = {
"a-tag": "text/html",
"area-tag": "text/html",
"beacon-request": "text/plain",
"fetch-request": "application/json",
"form-tag": "text/html",
"iframe-tag": "text/html",
"img-tag": "image/png",
"script-tag": "text/javascript",
"worker-request": "application/javascript",
"module-worker-top-level": "application/javascript",
"module-data-worker-import": "application/javascript",
"classic-data-worker-fetch": "application/javascript",
"xhr-request": "application/json",
"audio-tag": "audio/wav",
"video-tag": "video/ogg",
"picture-tag": "image/png",
"object-tag": "text/html",
"link-css-tag": "text/css",
"link-prefetch-tag": "text/html",
"websocket-request": "application/json"
};
for (const workletType of ['animation', 'audio', 'layout', 'paint']) { for (const workletType of ['animation', 'audio', 'layout', 'paint']) {
resourceMap[`worklet-${workletType}-top-level`] = resourceMap[`worklet-${workletType}-top-level`] =
url => requestViaWorklet(workletType, url); url => requestViaWorklet(workletType, url);
contentType[`worklet-${workletType}-top-level`] = subresourcePath[`worklet-${workletType}-top-level`] =
"application/javascript"; "/common/security-features/subresource/worker.py";
resourceMap[`worklet-${workletType}-data-import`] = resourceMap[`worklet-${workletType}-data-import`] =
url => requestViaWorklet(workletType, workerUrlThatImports(url)); url => requestViaWorklet(workletType, workerUrlThatImports(url));
contentType[`worklet-${workletType}-data-import`] = subresourcePath[`worklet-${workletType}-data-import`] =
"application/javascript"; "/common/security-features/subresource/worker.py";
} }
var httpProtocol = "http";
var httpsProtocol = "https";
var wsProtocol = "ws";
var wssProtocol = "wss";
var sameOriginHost = location.hostname;
var crossOriginHost = "{{domains[www1]}}";
// These values can evaluate to either empty strings or a ":port" string.
var httpPort = getNormalizedPort(parseInt("{{ports[http][0]}}", 10));
var httpsPort = getNormalizedPort(parseInt("{{ports[https][0]}}", 10));
var wsPort = getNormalizedPort(parseInt("{{ports[ws][0]}}", 10));
var wssPort = getNormalizedPort(parseInt("{{ports[wss][0]}}", 10));
const resourcePath = subresourcePath[scenario.subresource];
// Map all endpoints to scenario for use in the test.
var endpoint = {
"same-origin":
location.origin + resourcePath,
"same-host-https":
httpsProtocol + "://" + sameOriginHost + httpsPort + resourcePath,
"same-host-http":
httpProtocol + "://" + sameOriginHost + httpPort + resourcePath,
"cross-origin-https":
httpsProtocol + "://" + crossOriginHost + httpsPort + resourcePath,
"cross-origin-http":
httpProtocol + "://" + crossOriginHost + httpPort + resourcePath,
"same-host-wss":
wssProtocol + "://" + sameOriginHost + wssPort + resourcePath,
"same-host-ws":
wsProtocol + "://" + sameOriginHost + wsPort + resourcePath,
"cross-origin-wss":
wssProtocol + "://" + crossOriginHost + wssPort + resourcePath,
"cross-origin-ws":
wsProtocol + "://" + crossOriginHost + wsPort + resourcePath
};
sanityChecker.checkScenario(scenario, resourceMap); sanityChecker.checkScenario(scenario, resourceMap);
var mixed_content_test = async_test(description); var mixed_content_test = async_test(description);
@ -137,17 +139,14 @@ function MixedContentTestCase(scenario, description, sanityChecker) {
var value = guid(); var value = guid();
// We use the same path for both HTTP/S and WS/S stash requests. // We use the same path for both HTTP/S and WS/S stash requests.
var stash_path = encodeURIComponent("/mixed-content"); var stash_path = encodeURIComponent("/mixed-content");
var announceResourceRequestUrl = endpoint['same-origin'] + const stashEndpoint = "/common/security-features/subresource/xhr.py?key=" +
"?action=put&key=" + key + key + "&path=" + stash_path;
"&value=" + value + const announceResourceRequestUrl = stashEndpoint + "&action=put&value=" +
"&path=" + stash_path; value;
var assertResourceRequestUrl = endpoint['same-origin'] + const assertResourceRequestUrl = stashEndpoint + "&action=take";
"?action=take&key=" + key + const resourceRequestUrl = endpoint[scenario.origin] + "?redirection=" +
"&path=" + stash_path;
var resourceRequestUrl = endpoint[scenario.origin] + "?redirection=" +
scenario.redirection + "&action=purge&key=" + key + scenario.redirection + "&action=purge&key=" + key +
"&path=" + stash_path + "&content_type=" + "&path=" + stash_path;
contentType[scenario.subresource];
xhrRequest(announceResourceRequestUrl) xhrRequest(announceResourceRequestUrl)
.then(mixed_content_test.step_func(_ => { .then(mixed_content_test.step_func(_ => {

View file

@ -1 +0,0 @@
postMessage("", "*");

View file

@ -1 +0,0 @@
postMessage('done');

View file

@ -223,7 +223,6 @@ var scenario = {
"source_protocol": "http", "source_protocol": "http",
"target_protocol": "http", "target_protocol": "http",
"subresource": "iframe-tag", "subresource": "iframe-tag",
"subresource_path": "/referrer-policy/generic/subresource/document.py",
"referrer_url": "origin" "referrer_url": "origin"
}; };
``` ```

View file

@ -1,7 +1,7 @@
These tests exercise different ways to fetch a resource (image, font-face, svg These tests exercise different ways to fetch a resource (image, font-face, svg
references), generated via the sub-resource python script in references), generated via the sub-resource python script in
```./generic/subresource/``` (for example, loading an image: ```./generic/subresource/``` (for example, loading an image:
```/referrer-policy/generic/subresource/image.py?id=<UUID>```) and later verify ```/common/security-features/subresource/image.py?id=<UUID>```) and later verify
the headers used to fetch the resource. the headers used to fetch the resource.
Since there is no way to wait for a resource referenced from CSS to be loaded, Since there is no way to wait for a resource referenced from CSS to be loaded,
@ -11,4 +11,4 @@ after the resource (hopefully) was loaded.
Since there is also no way to retrieve headers (or other information) from Since there is also no way to retrieve headers (or other information) from
resources loaded via CSS, we store the headers with the given ```UUID``` as key resources loaded via CSS, we store the headers with the given ```UUID``` as key
on the server, and retrieve them later via an XHR, for example: on the server, and retrieve them later via an XHR, for example:
```/referrer-policy/generic/subresource/image.py?id=<UUID>&report-headers```. ```/common/security-features/subresource/image.py?id=<UUID>&report-headers```.

View file

@ -21,9 +21,9 @@
let id = token(); let id = token();
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port; let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
let css_url = url_prefix + let css_url = url_prefix +
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "/common/security-features/subresource/stylesheet.py?id=" + id +
"&import-rule" + "&referrer-policy=no-referrer"; "&import-rule" + "&referrer-policy=no-referrer";
let check_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py" + let check_url = url_prefix + "/common/security-features/subresource/stylesheet.py" +
"?id=" + id + "&report-headers"; "?id=" + id + "&report-headers";
return new Promise(resolve => { return new Promise(resolve => {

View file

@ -20,8 +20,8 @@
promise_test(function(css_test) { promise_test(function(css_test) {
let id = token(); let id = token();
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port; let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
let css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&import-rule"; let css_url = url_prefix + "/common/security-features/subresource/stylesheet.py?id=" + id + "&import-rule";
let check_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py" + let check_url = url_prefix + "/common/security-features/subresource/stylesheet.py" +
"?id=" + id + "&report-headers"; "?id=" + id + "&report-headers";
let style = document.createElement("style"); let style = document.createElement("style");

View file

@ -20,7 +20,7 @@
let id = token(); let id = token();
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + let url_prefix = location.protocol + "//www1." + location.hostname + ":" +
location.port + location.port +
"/referrer-policy/generic/subresource/stylesheet.py?id=" + "/common/security-features/subresource/stylesheet.py?id=" +
id; id;
let css_url = url_prefix + "&amp;import-rule"; let css_url = url_prefix + "&amp;import-rule";
let expected = url_prefix + "&import-rule"; let expected = url_prefix + "&import-rule";

View file

@ -1,6 +1,6 @@
var svg_ns = "http://www.w3.org/2000/svg"; var svg_ns = "http://www.w3.org/2000/svg";
var url_prefix = location.protocol + "//" + location.hostname + ":" + var url_prefix = location.protocol + "//" + location.hostname + ":" +
location.port + "/referrer-policy/generic/subresource/"; location.port + "/common/security-features/subresource/";
var svg_test_properties = [ var svg_test_properties = [
'fill', 'fill',

View file

@ -22,12 +22,12 @@
let id = token(); let id = token();
let css_url = location.protocol + "//www1." + location.hostname + ":" + let css_url = location.protocol + "//www1." + location.hostname + ":" +
location.port + location.port +
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "/common/security-features/subresource/stylesheet.py?id=" + id +
"&import-rule" + "&type=font"; "&import-rule" + "&type=font";
let url_prefix = location.protocol + "//" + location.hostname + ":" + location.port; let url_prefix = location.protocol + "//" + location.hostname + ":" + location.port;
let css_referrer = url_prefix + let css_referrer = url_prefix +
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&type=font"; "/common/security-features/subresource/stylesheet.py?id=" + id + "&type=font";
let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" + let font_url = url_prefix + "/common/security-features/subresource/font.py" +
"?id=" + id + "&report-headers" + "&type=font"; "?id=" + id + "&report-headers" + "&type=font";
return new Promise(resolve => { return new Promise(resolve => {

View file

@ -20,8 +20,8 @@
promise_test(function(css_test) { promise_test(function(css_test) {
let id = token(); let id = token();
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port; let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
let css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "&type=font"; let css_url = url_prefix + "/common/security-features/subresource/stylesheet.py?id=" + id + "&type=font";
let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" + let font_url = url_prefix + "/common/security-features/subresource/font.py" +
"?id=" + id + "&report-headers"; "?id=" + id + "&report-headers";
return new Promise(resolve => { return new Promise(resolve => {

View file

@ -21,7 +21,7 @@
promise_test(function(css_test) { promise_test(function(css_test) {
let id = token(); let id = token();
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + let url_prefix = location.protocol + "//www1." + location.hostname + ":" +
location.port + "/referrer-policy/generic/subresource/"; location.port + "/common/security-features/subresource/";
let css_url = url_prefix + "stylesheet.py?id=" + id + "&type=font"; let css_url = url_prefix + "stylesheet.py?id=" + id + "&type=font";
let font_url = url_prefix + "font.py?report-headers&id=" + id; let font_url = url_prefix + "font.py?report-headers&id=" + id;

View file

@ -21,7 +21,7 @@
let id = token(); let id = token();
let css_url = location.protocol + "//www1." + location.hostname + ":" + let css_url = location.protocol + "//www1." + location.hostname + ":" +
location.port + location.port +
"/referrer-policy/generic/subresource/font.py" + "?id=" + "/common/security-features/subresource/font.py" + "?id=" +
id + "&type=font"; id + "&type=font";
let font_url = css_url + "&report-headers"; let font_url = css_url + "&report-headers";

View file

@ -22,12 +22,12 @@
let id = token(); let id = token();
let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port; let url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
let css_url = url_prefix + let css_url = url_prefix +
"/referrer-policy/generic/subresource/stylesheet.py?id=" + "/common/security-features/subresource/stylesheet.py?id=" +
id + "&amp;type=font"; id + "&amp;type=font";
let expected = url_prefix + let expected = url_prefix +
"/referrer-policy/generic/subresource/stylesheet.py?id=" + "/common/security-features/subresource/stylesheet.py?id=" +
id + "&type=font"; id + "&type=font";
let font_url = url_prefix + "/referrer-policy/generic/subresource/font.py" + let font_url = url_prefix + "/common/security-features/subresource/font.py" +
"?id=" + id + "&report-headers"; "?id=" + id + "&report-headers";
let processingInstruction = let processingInstruction =

View file

@ -21,13 +21,13 @@
promise_test(function(css_test) { promise_test(function(css_test) {
var id = token(); var id = token();
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port +
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "/common/security-features/subresource/stylesheet.py?id=" + id +
"&import-rule" + "&type=image"; "&import-rule" + "&type=image";
var url_prefix = location.protocol + "//" + location.hostname + ":" + location.port; var url_prefix = location.protocol + "//" + location.hostname + ":" + location.port;
var css_referrer = url_prefix + var css_referrer = url_prefix +
"/referrer-policy/generic/subresource/stylesheet.py?id=" + id + "/common/security-features/subresource/stylesheet.py?id=" + id +
"&type=image"; "&type=image";
var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" + var img_url = url_prefix + "/common/security-features/subresource/image.py" +
"?id=" + id + "&report-headers"; "?id=" + id + "&report-headers";
return new Promise(resolve => { return new Promise(resolve => {

View file

@ -20,8 +20,8 @@
promise_test(function(css_test) { promise_test(function(css_test) {
var id = token(); var id = token();
var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port; var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
var css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id; var css_url = url_prefix + "/common/security-features/subresource/stylesheet.py?id=" + id;
var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" + var img_url = url_prefix + "/common/security-features/subresource/image.py" +
"?id=" + id + "&report-headers"; "?id=" + id + "&report-headers";
return new Promise(resolve => { return new Promise(resolve => {

View file

@ -19,7 +19,7 @@
<script> <script>
promise_test(function(css_test) { promise_test(function(css_test) {
var id = token(); var id = token();
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id; var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/common/security-features/subresource/image.py" + "?id=" + id;
var img_url = css_url + "&report-headers"; var img_url = css_url + "&report-headers";
var div = document.querySelector("div.styled"); var div = document.querySelector("div.styled");

View file

@ -20,7 +20,7 @@
<script> <script>
promise_test(function(css_test) { promise_test(function(css_test) {
var id = token(); var id = token();
var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/"; var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port + "/common/security-features/subresource/";
var css_url = url_prefix + "stylesheet.py?id=" + id; var css_url = url_prefix + "stylesheet.py?id=" + id;
var img_url = url_prefix + "image.py?report-headers&id=" + id; var img_url = url_prefix + "image.py?report-headers&id=" + id;

View file

@ -19,7 +19,7 @@
<script> <script>
promise_test(function(css_test) { promise_test(function(css_test) {
var id = token(); var id = token();
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id; var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/common/security-features/subresource/image.py" + "?id=" + id;
var img_url = css_url + "&report-headers"; var img_url = css_url + "&report-headers";
var style = document.createElement("style"); var style = document.createElement("style");

View file

@ -17,7 +17,7 @@
<script> <script>
promise_test(function(css_test) { promise_test(function(css_test) {
var id = token(); var id = token();
var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/referrer-policy/generic/subresource/image.py" + "?id=" + id; var css_url = location.protocol + "//www1." + location.hostname + ":" + location.port + "/common/security-features/subresource/image.py" + "?id=" + id;
var img_url = css_url + "&report-headers"; var img_url = css_url + "&report-headers";
document.body.background = css_url; document.body.background = css_url;

View file

@ -21,8 +21,8 @@
promise_test(function(css_test) { promise_test(function(css_test) {
var id = token(); var id = token();
var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port; var url_prefix = location.protocol + "//www1." + location.hostname + ":" + location.port;
var css_url = url_prefix + "/referrer-policy/generic/subresource/stylesheet.py?id=" + id; var css_url = url_prefix + "/common/security-features/subresource/stylesheet.py?id=" + id;
var img_url = url_prefix + "/referrer-policy/generic/subresource/image.py" + var img_url = url_prefix + "/common/security-features/subresource/image.py" +
"?id=" + id + "&report-headers"; "?id=" + id + "&report-headers";
var processingInstruction = document.createProcessingInstruction("xml-stylesheet", "href=\"" + css_url + "\" type=\"text/css\""); var processingInstruction = document.createProcessingInstruction("xml-stylesheet", "href=\"" + css_url + "\" type=\"text/css\"");

View file

@ -28,7 +28,7 @@
<script src = "/common/security-features/resources/common.js"></` + `script> <script src = "/common/security-features/resources/common.js"></` + `script>
<script src = "/referrer-policy/generic/referrer-policy-test-case.js"></` + `script> <script src = "/referrer-policy/generic/referrer-policy-test-case.js"></` + `script>
<script> <script>
var urlPath = "/referrer-policy/generic/subresource/xhr.py"; var urlPath = "/common/security-features/subresource/xhr.py";
var url = "${location.protocol}//www1.${location.hostname}:${location.port}" + urlPath; var url = "${location.protocol}//www1.${location.hostname}:${location.port}" + urlPath;
requestViaXhr(url).then((msg) => { requestViaXhr(url).then((msg) => {
parent.postMessage({referrer: msg.referrer}, "*")}) parent.postMessage({referrer: msg.referrer}, "*")})

View file

@ -7,14 +7,14 @@
<!-- Common global functions for referrer-policy tests. --> <!-- Common global functions for referrer-policy tests. -->
<script src="/common/security-features/resources/common.js"></script> <script src="/common/security-features/resources/common.js"></script>
<meta name="referrer" content="origin"> <meta name="referrer" content="origin">
<link rel="prefetch" href="/referrer-policy/generic/subresource/image.py"> <link rel="prefetch" href="/common/security-features/subresource/image.py">
</head> </head>
<body> <body>
<p>Check that resources loaded via link rel prefetch use the referrer <p>Check that resources loaded via link rel prefetch use the referrer
and referrer policy from the document.</p> and referrer policy from the document.</p>
<script> <script>
var img_url = "/referrer-policy/generic/subresource/image.py"; var img_url = "/common/security-features/subresource/image.py";
promise_test((t) => timeoutPromise(t, 1000) promise_test((t) => timeoutPromise(t, 1000)
.then(() => loadImageInWindow(img_url, null, window)) .then(() => loadImageInWindow(img_url, null, window))
.then(function (img) { .then(function (img) {

View file

@ -16,7 +16,7 @@
<script> <script>
promise_test(() => { promise_test(() => {
var urlPath = '/referrer-policy/generic/subresource/image.py?cache_destroyer=' + (new Date()).getTime(); var urlPath = '/common/security-features/subresource/image.py?cache_destroyer=' + (new Date()).getTime();
var url = location.protocol + "//www1." + location.hostname + ":" + location.port + var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
urlPath; urlPath;
return requestViaImageForReferrerPolicy(url, null, 'no-referrer') return requestViaImageForReferrerPolicy(url, null, 'no-referrer')

View file

@ -16,7 +16,7 @@
<script> <script>
promise_test(() => { promise_test(() => {
var urlPath = '/referrer-policy/generic/subresource/image.py?cache_destroyer=' + (new Date()).getTime(); var urlPath = '/common/security-features/subresource/image.py?cache_destroyer=' + (new Date()).getTime();
var url = location.protocol + "//www1." + location.hostname + ":" + location.port + var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
urlPath; urlPath;
return requestViaImageForReferrerPolicy(url, null, 'no-referrer') return requestViaImageForReferrerPolicy(url, null, 'no-referrer')

View file

@ -16,7 +16,7 @@
<script> <script>
promise_test(() => { promise_test(() => {
var urlPath = '/referrer-policy/generic/subresource/image.py?cache_destroyer=' + (new Date()).getTime(); var urlPath = '/common/security-features/subresource/image.py?cache_destroyer=' + (new Date()).getTime();
var url = location.protocol + "//www1." + location.hostname + ":" + location.port + var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
urlPath; urlPath;
return requestViaImageForReferrerPolicy(url, null, 'no-referrer') return requestViaImageForReferrerPolicy(url, null, 'no-referrer')

View file

@ -16,7 +16,7 @@
<script> <script>
promise_test(() => { promise_test(() => {
var urlPath = '/referrer-policy/generic/subresource/image.py?cache_destroyer=' + (new Date()).getTime(); var urlPath = '/common/security-features/subresource/image.py?cache_destroyer=' + (new Date()).getTime();
var url = location.protocol + "//www1." + location.hostname + ":" + location.port + var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
urlPath; urlPath;
return requestViaImageForReferrerPolicy(url, null, 'no-referrer') return requestViaImageForReferrerPolicy(url, null, 'no-referrer')

View file

@ -16,7 +16,7 @@
<script> <script>
promise_test(() => { promise_test(() => {
var urlPath = '/referrer-policy/generic/subresource/image.py?cache_destroyer=' + (new Date()).getTime(); var urlPath = '/common/security-features/subresource/image.py?cache_destroyer=' + (new Date()).getTime();
var url = location.protocol + "//www1." + location.hostname + ":" + location.port + var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
urlPath; urlPath;
return requestViaImageForReferrerPolicy(url, null, 'no-referrer') return requestViaImageForReferrerPolicy(url, null, 'no-referrer')

View file

@ -51,16 +51,16 @@ function ReferrerPolicyTestCase(scenario, testDescription, sanityChecker) {
}; };
const subresourcePath = { const subresourcePath = {
"a-tag": "/referrer-policy/generic/subresource/document.py", "a-tag": "/common/security-features/subresource/document.py",
"area-tag": "/referrer-policy/generic/subresource/document.py", "area-tag": "/common/security-features/subresource/document.py",
"fetch-request": "/referrer-policy/generic/subresource/xhr.py", "fetch-request": "/common/security-features/subresource/xhr.py",
"iframe-tag": "/referrer-policy/generic/subresource/document.py", "iframe-tag": "/common/security-features/subresource/document.py",
"img-tag": "/referrer-policy/generic/subresource/image.py", "img-tag": "/common/security-features/subresource/image.py",
"script-tag": "/referrer-policy/generic/subresource/script.py", "script-tag": "/common/security-features/subresource/script.py",
"worker-request": "/referrer-policy/generic/subresource/worker.py", "worker-request": "/common/security-features/subresource/worker.py",
"module-worker": "/referrer-policy/generic/subresource/worker.py", "module-worker": "/common/security-features/subresource/worker.py",
"shared-worker": "/referrer-policy/generic/subresource/shared-worker.py", "shared-worker": "/common/security-features/subresource/shared-worker.py",
"xhr-request": "/referrer-policy/generic/subresource/xhr.py" "xhr-request": "/common/security-features/subresource/xhr.py"
}; };
var referrerUrlResolver = { var referrerUrlResolver = {

View file

@ -29,7 +29,7 @@
<script src = "/common/security-features/resources/common.js"></` + `script> <script src = "/common/security-features/resources/common.js"></` + `script>
<script src = "/referrer-policy/generic/referrer-policy-test-case.js"></` + `script> <script src = "/referrer-policy/generic/referrer-policy-test-case.js"></` + `script>
<script> <script>
var urlPath = "/referrer-policy/generic/subresource/xhr.py"; var urlPath = "/common/security-features/subresource/xhr.py";
var url = "${location.protocol}//www1.${location.hostname}:${location.port}" + urlPath; var url = "${location.protocol}//www1.${location.hostname}:${location.port}" + urlPath;
requestViaXhr(url).then((msg) => { requestViaXhr(url).then((msg) => {
parent.postMessage({referrer: msg.referrer, description: "${description}"}, "*") parent.postMessage({referrer: msg.referrer, description: "${description}"}, "*")

View file

@ -18,7 +18,7 @@
<script> <script>
promise_test(function() { promise_test(function() {
var urlPath = '/referrer-policy/generic/subresource/document.py'; var urlPath = '/common/security-features/subresource/document.py';
var url = location.protocol + "//www1." + location.hostname + ":" + location.port + var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
urlPath; urlPath;
return requestViaArea(url) return requestViaArea(url)

View file

@ -22,7 +22,7 @@
}, "Fetch is supported by the browser."); }, "Fetch is supported by the browser.");
promise_test(function() { promise_test(function() {
var urlPath = '/referrer-policy/generic/subresource/xhr.py'; var urlPath = '/common/security-features/subresource/xhr.py';
var url = location.protocol + "//" + location.hostname + ":" + var url = location.protocol + "//" + location.hostname + ":" +
location.port + urlPath; location.port + urlPath;
return requestViaFetch(url) return requestViaFetch(url)

View file

@ -18,7 +18,7 @@
<script> <script>
promise_test(function() { promise_test(function() {
var urlPath = '/referrer-policy/generic/subresource/document.py'; var urlPath = '/common/security-features/subresource/document.py';
var url = location.protocol + "//www1." + location.hostname + ":" + location.port + var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
urlPath; urlPath;
return requestViaIframe(url) return requestViaIframe(url)

View file

@ -18,7 +18,7 @@
<script> <script>
promise_test(function() { promise_test(function() {
var urlPath = '/referrer-policy/generic/subresource/image.py'; var urlPath = '/common/security-features/subresource/image.py';
var url = location.protocol + "//www1." + location.hostname + ":" + location.port + var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
urlPath + "?cache_destroyer=" + (new Date()).getTime(); urlPath + "?cache_destroyer=" + (new Date()).getTime();
return requestViaImageForReferrerPolicy(url, undefined, "always") return requestViaImageForReferrerPolicy(url, undefined, "always")

View file

@ -18,7 +18,7 @@
<script> <script>
promise_test(function() { promise_test(function() {
var urlPath = '/referrer-policy/generic/subresource/document.py'; var urlPath = '/common/security-features/subresource/document.py';
var url = location.protocol + "//www1." + location.hostname + ":" + location.port + var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
urlPath; urlPath;
return requestViaAnchor(url) return requestViaAnchor(url)

View file

@ -18,7 +18,7 @@
<script> <script>
promise_test(function() { promise_test(function() {
var urlPath = '/referrer-policy/generic/subresource/script.py'; var urlPath = '/common/security-features/subresource/script.py';
var url = location.protocol + "//www1." + location.hostname + ":" + location.port + var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
urlPath; urlPath;
return requestViaScript(url) return requestViaScript(url)

View file

@ -18,7 +18,7 @@
<script> <script>
promise_test(function() { promise_test(function() {
var urlPath = '/referrer-policy/generic/subresource/worker.py'; var urlPath = '/common/security-features/subresource/worker.py';
var url = location.protocol + "//" + location.hostname + ":" + var url = location.protocol + "//" + location.hostname + ":" +
location.port + urlPath; location.port + urlPath;
return requestViaDedicatedWorker(url, {}) return requestViaDedicatedWorker(url, {})

View file

@ -18,7 +18,7 @@
<script> <script>
promise_test(function() { promise_test(function() {
var urlPath = '/referrer-policy/generic/subresource/xhr.py'; var urlPath = '/common/security-features/subresource/xhr.py';
var url = location.protocol + "//www1." + location.hostname + ":" + location.port + var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
urlPath; urlPath;
return requestViaXhr(url) return requestViaXhr(url)

View file

@ -1,3 +0,0 @@
div.styled::before {
content:url(/referrer-policy/generic/subresource/image.py?id=%(id)s)
}

View file

@ -1,3 +0,0 @@
path {
%(property)s: url(/referrer-policy/generic/subresource/svg.py?id=%(id)s#invalidFragment);
}

View file

@ -17,7 +17,7 @@
<script> <script>
promise_test(function() { promise_test(function() {
var urlPath = '/referrer-policy/generic/subresource/image.py?cache_destroyer=' + (new Date()).getTime(); var urlPath = '/common/security-features/subresource/image.py?cache_destroyer=' + (new Date()).getTime();
var url = location.protocol + "//www1." + location.hostname + ":" + location.port + var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
urlPath; urlPath;
return requestViaImageForReferrerPolicy(url, null, 'always') return requestViaImageForReferrerPolicy(url, null, 'always')

View file

@ -59,7 +59,7 @@ promise_test(function(t) {
.then(function() { .then(function() {
assert_not_equals(sw_registration.active, null, assert_not_equals(sw_registration.active, null,
'Registration active worker should not be null'); 'Registration active worker should not be null');
fetch_tests_from_worker(sw_registration.active); return fetch_tests_from_worker(sw_registration.active);
}); });
}, 'Test skipWaiting while a client is using the registration'); }, 'Test skipWaiting while a client is using the registration');

View file

@ -37,7 +37,7 @@ promise_test(function(t) {
'Document controller should still be null'); 'Document controller should still be null');
assert_not_equals(sw_registration.active, null, assert_not_equals(sw_registration.active, null,
'Registration active worker should not be null'); 'Registration active worker should not be null');
fetch_tests_from_worker(sw_registration.active); return fetch_tests_from_worker(sw_registration.active);
}); });
}, 'Test skipWaiting while a client is not being controlled'); }, 'Test skipWaiting while a client is not being controlled');

View file

@ -23,4 +23,44 @@ detection_test("FaceDetectionTest", async (t, detectionTest) => {
assert_equals(mock.getFastMode(), true, "maxDetectedFaces"); assert_equals(mock.getFastMode(), true, "maxDetectedFaces");
}, "Test that FaceDetectionOptions are correctly propagated"); }, "Test that FaceDetectionOptions are correctly propagated");
detection_test("BarcodeDetectionTest", async (t, detectionTest) => {
const img = document.getElementById("img");
const mock = detectionTest.MockBarcodeDetectionProvider();
const detectorWithNoOptions = new BarcodeDetector();
let barcodeDetectionResult = await detectorWithNoOptions.detect(img);
assert_array_equals(mock.getFormats(), [], "formats");
const detectorWithOptions = new BarcodeDetector({
formats: ["code_128", "qr_code"]});
barcodeDetectionResult = await detectorWithOptions.detect(img);
assert_array_equals(
mock.getFormats(),
[shapeDetection.mojom.BarcodeFormat.CODE_128,
shapeDetection.mojom.BarcodeFormat.QR_CODE],
"formats");
try {
new BarcodeDetector({formats: []});
assert_unreached("providing hint option that is empty should fail");
} catch (error) {
assert_equals(error.name, "TypeError");
}
try {
new BarcodeDetector({formats: ["unknown"]});
assert_unreached("providing \"unknown\" as a hint option should fail");
} catch (error) {
assert_equals(error.name, "TypeError");
}
try {
new BarcodeDetector({formats: ["foo", "bar"]});
assert_unreached(
"providing hint option with unrecognized formats should fail");
} catch (error) {
assert_equals(error.name, "TypeError");
}
}, "Test that BarcodeDetectorOptions are correctly propagated");
</script> </script>

View file

@ -1,6 +1,7 @@
// META: global=worker,jsshell // META: global=worker,jsshell
// META: script=../resources/rs-utils.js // META: script=../resources/rs-utils.js
// META: script=../resources/test-utils.js // META: script=../resources/test-utils.js
// META: script=../resources/recording-streams.js
'use strict'; 'use strict';
test(() => { test(() => {
@ -158,7 +159,7 @@ promise_test(() => {
}) })
]); ]);
}, 'ReadableStream teeing: canceling branch2 should not impact branch2'); }, 'ReadableStream teeing: canceling branch2 should not impact branch1');
promise_test(() => { promise_test(() => {
@ -340,3 +341,111 @@ test(t => {
assert_not_equals(getReader.call(rs2), undefined, 'getReader should work on rs2'); assert_not_equals(getReader.call(rs2), undefined, 'getReader should work on rs2');
}, 'ReadableStreamTee should not use a modified ReadableStream constructor from the global object'); }, 'ReadableStreamTee should not use a modified ReadableStream constructor from the global object');
promise_test(t => {
const rs = recordingReadableStream({}, { highWaterMark: 0 });
// Create two branches, each with a HWM of 1. This should result in one
// chunk being pulled, not two.
rs.tee();
return flushAsyncEvents().then(() => {
assert_array_equals(rs.events, ['pull'], 'pull should only be called once');
});
}, 'ReadableStreamTee should not pull more chunks than can fit in the branch queue');
promise_test(t => {
const rs = recordingReadableStream({
pull(controller) {
controller.enqueue('a');
}
}, { highWaterMark: 0 });
const [reader1, reader2] = rs.tee().map(branch => branch.getReader());
return Promise.all([reader1.read(), reader2.read()])
.then(() => {
assert_array_equals(rs.events, ['pull', 'pull'], 'pull should be called twice');
});
}, 'ReadableStreamTee should only pull enough to fill the emptiest queue');
promise_test(t => {
const rs = recordingReadableStream({}, { highWaterMark: 0 });
const theError = { name: 'boo!' };
rs.controller.error(theError);
const [reader1, reader2] = rs.tee().map(branch => branch.getReader());
return flushAsyncEvents().then(() => {
assert_array_equals(rs.events, [], 'pull should not be called');
return Promise.all([
promise_rejects(t, theError, reader1.closed),
promise_rejects(t, theError, reader2.closed)
]);
});
}, 'ReadableStreamTee should not pull when original is already errored');
for (const branch of [1, 2]) {
promise_test(t => {
const rs = recordingReadableStream({}, { highWaterMark: 0 });
const theError = { name: 'boo!' };
const [reader1, reader2] = rs.tee().map(branch => branch.getReader());
return flushAsyncEvents().then(() => {
assert_array_equals(rs.events, ['pull'], 'pull should be called once');
rs.controller.enqueue('a');
const reader = (branch === 1) ? reader1 : reader2;
return reader.read();
}).then(() => flushAsyncEvents()).then(() => {
assert_array_equals(rs.events, ['pull', 'pull'], 'pull should be called twice');
rs.controller.error(theError);
return Promise.all([
promise_rejects(t, theError, reader1.closed),
promise_rejects(t, theError, reader2.closed)
]);
}).then(() => flushAsyncEvents()).then(() => {
assert_array_equals(rs.events, ['pull', 'pull'], 'pull should be called twice');
});
}, `ReadableStreamTee stops pulling when original stream errors while branch ${branch} is reading`);
}
promise_test(t => {
const rs = recordingReadableStream({}, { highWaterMark: 0 });
const theError = { name: 'boo!' };
const [reader1, reader2] = rs.tee().map(branch => branch.getReader());
return flushAsyncEvents().then(() => {
assert_array_equals(rs.events, ['pull'], 'pull should be called once');
rs.controller.enqueue('a');
return Promise.all([reader1.read(), reader2.read()]);
}).then(() => flushAsyncEvents()).then(() => {
assert_array_equals(rs.events, ['pull', 'pull'], 'pull should be called twice');
rs.controller.error(theError);
return Promise.all([
promise_rejects(t, theError, reader1.closed),
promise_rejects(t, theError, reader2.closed)
]);
}).then(() => flushAsyncEvents()).then(() => {
assert_array_equals(rs.events, ['pull', 'pull'], 'pull should be called twice');
});
}, 'ReadableStreamTee stops pulling when original stream errors while both branches are reading');

View file

@ -1,11 +0,0 @@
#!/bin/bash
set -ex
mkdir -p ~/meta
WPT_MANIFEST_FILE=~/meta/MANIFEST.json
./wpt manifest -p $WPT_MANIFEST_FILE
gzip -k -f --best $WPT_MANIFEST_FILE
bzip2 -k -f --best $WPT_MANIFEST_FILE
zstd -k -f --ultra -22 $WPT_MANIFEST_FILE

View file

@ -1,10 +0,0 @@
#!/bin/bash
set -ex
SCRIPT_DIR=$(cd $(dirname "$0") && pwd -P)
WPT_ROOT=$SCRIPT_DIR/../..
cd $WPT_ROOT
mkdir -p ~/meta
./wpt manifest -p ~/meta/MANIFEST.json
./wpt lint --all

View file

@ -1,6 +1,7 @@
import json import json
import logging import logging
import os import os
import subprocess
import sys import sys
import requests import requests
@ -17,6 +18,32 @@ logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class Status(object):
SUCCESS = 0
FAIL = 1
NEUTRAL = 78
def run(cmd, return_stdout=False, **kwargs):
logger.info(" ".join(cmd))
if return_stdout:
f = subprocess.check_output
else:
f = subprocess.check_call
return f(cmd, **kwargs)
def create_manifest(path):
run(["./wpt", "manifest", "-p", path])
def compress_manifest(path):
for args in [["gzip", "-k", "-f", "--best"],
["bzip2", "-k", "-f", "--best"],
["zstd", "-k", "-f", "--ultra", "-22"]]:
run(args + [path])
def request(url, desc, data=None, json_data=None, params=None, headers=None): def request(url, desc, data=None, json_data=None, params=None, headers=None):
github_token = os.environ.get("GITHUB_TOKEN") github_token = os.environ.get("GITHUB_TOKEN")
default_headers = { default_headers = {
@ -92,7 +119,7 @@ def tag(owner, repo, sha, tag):
return True return True
def create_release(owner, repo, sha, tag, summary, body): def create_release(manifest_path, owner, repo, sha, tag, summary, body):
if body: if body:
body = "%s\n%s" % (summary, body) body = "%s\n%s" % (summary, body)
else: else:
@ -117,7 +144,7 @@ def create_release(owner, repo, sha, tag, summary, body):
params = {"name": upload_filename, params = {"name": upload_filename,
"label": "MANIFEST.json%s" % upload_ext} "label": "MANIFEST.json%s" % upload_ext}
with open(os.path.expanduser("~/meta/MANIFEST.json%s" % upload_ext), "rb") as f: with open("%s%s" % (manifest_path, upload_ext), "rb") as f:
upload_data = f.read() upload_data = f.read()
logger.info("Uploading %s bytes" % len(upload_data)) logger.info("Uploading %s bytes" % len(upload_data))
@ -148,7 +175,7 @@ def main():
repo_key = "GITHUB_REPOSITORY" repo_key = "GITHUB_REPOSITORY"
if not should_run_action(): if not should_run_action():
return return Status.NEUTRAL
owner, repo = os.environ[repo_key].split("/", 1) owner, repo = os.environ[repo_key].split("/", 1)
@ -162,16 +189,28 @@ def main():
else: else:
tag_name = "merge_pr_%s" % pr tag_name = "merge_pr_%s" % pr
manifest_path = os.path.expanduser(os.path.join("~", "meta", "MANIFEST.json"))
os.makedirs(os.path.dirname(manifest_path))
create_manifest(manifest_path)
compress_manifest(manifest_path)
tagged = tag(owner, repo, head_rev, tag_name) tagged = tag(owner, repo, head_rev, tag_name)
if not tagged: if not tagged:
sys.exit(1) return Status.FAIL
summary = git("show", "--no-patch", '--format="%s"', "HEAD") summary = git("show", "--no-patch", '--format="%s"', "HEAD")
body = git("show", "--no-patch", '--format="%b"', "HEAD") body = git("show", "--no-patch", '--format="%b"', "HEAD")
if not create_release(owner, repo, head_rev, tag_name, summary, body): if not create_release(manifest_path, owner, repo, head_rev, tag_name, summary, body):
sys.exit(1) return Status.FAIL
return Status.SUCCESS
if __name__ == "__main__": if __name__ == "__main__":
main() code = main()
assert isinstance(code, int)
sys.exit(code)

View file

@ -223,7 +223,7 @@ def setup_environment(args):
def setup_repository(): def setup_repository():
if os.environ.get("GITHUB_PULL_REQUEST", "false") != "false": if os.environ.get("GITHUB_PULL_REQUEST", "false") != "false":
parents = run(["git", "show", "--format=%P", "task_head"], return_stdout=True).strip().split() parents = run(["git", "show", "--no-patch", "--format=%P", "task_head"], return_stdout=True).strip().split()
if len(parents) == 2: if len(parents) == 2:
base_head = parents[0] base_head = parents[0]
pr_head = parents[1] pr_head = parents[1]
@ -233,6 +233,9 @@ def setup_repository():
else: else:
print("ERROR: Pull request HEAD wasn't a 2-parent merge commit; " print("ERROR: Pull request HEAD wasn't a 2-parent merge commit; "
"expected to test the merge of PR into the base") "expected to test the merge of PR into the base")
commit = run(["git", "show", "--no-patch", "--format=%H", "task_head"], return_stdout=True).strip()
print("HEAD: %s" % commit)
print("Parents: %s" % ", ".join(parents))
sys.exit(1) sys.exit(1)
branch = os.environ.get("GITHUB_BRANCH") branch = os.environ.get("GITHUB_BRANCH")
@ -260,6 +263,8 @@ def main():
job = args.job job = args.job
print("Job %s" % job)
run_if = [(lambda: job == "all", "job set to 'all'"), run_if = [(lambda: job == "all", "job set to 'all'"),
(lambda:"all" in extra_jobs, "Manually specified jobs includes 'all'"), (lambda:"all" in extra_jobs, "Manually specified jobs includes 'all'"),
(lambda:job in extra_jobs, "Manually specified jobs includes '%s'" % job), (lambda:job in extra_jobs, "Manually specified jobs includes '%s'" % job),

View file

@ -1,8 +1,8 @@
html5lib==1.0.1 html5lib==1.0.1
mozinfo==0.10 mozinfo==1.1.0
mozlog==4.0 mozlog==4.0
mozdebug==0.1.1 mozdebug==0.1.1
pillow==5.4.1 pillow==6.0.0
urllib3[secure]==1.24.1 urllib3[secure]==1.24.1
requests==2.21.0 requests==2.21.0
six>=1.8 six>=1.8

Some files were not shown because too many files have changed in this diff Show more