Skip to content

Commit

Permalink
Fix test exclusion logic of wpt/referrer-policy test generator
Browse files Browse the repository at this point in the history
Previously, all worker-request, a-tag, area-tag tests were excluded
because "redirection" field was not included in |selection_pattern|,
and thus "worker-requests-with-swap-origin-redirect" and
"overhead-for-redirection" entries in "excluded_tests" in spec.src.json
were applied to all redirection types.

This CL
- Includes "redirection" field in |selection_pattern| and
  instead remove "redirection" field from filenames, and
- Regenerates tests.

Therefore, this CL
- Adds new test files for worker-request, a-tag, area-tag, and
- Renames existing test files.

The only manual changes are
- referrer-policy/generic/tools/common_paths.py
- third_party/WebKit/LayoutTests/SlowTests
- third_party/WebKit/LayoutTests/SmokeTests
and all other modifications are made by
referrer-policy/generic/tools/generate.py.

Bug: 880027
Change-Id: Ie628f92b334d6e2adddc5957cc6cceaa8c69f322
Reviewed-on: https://chromium-review.googlesource.com/c/1330901
Reviewed-by: Hiroki Nakagawa <[email protected]>
Reviewed-by: Jochen Eisinger <[email protected]>
Reviewed-by: Dirk Pranke <[email protected]>
Commit-Queue: Hiroshige Hayashizaki <[email protected]>
Cr-Commit-Position: refs/heads/master@{#609433}
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 1920 and retry the command.
  • Loading branch information
hiroshige-g authored and chromium-wpt-export-bot committed Nov 19, 2018
1 parent f02babe commit b6a5f11
Show file tree
Hide file tree
Showing 2,113 changed files with 5,955 additions and 2 deletions.
5 changes: 3 additions & 2 deletions referrer-policy/generic/tools/common_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
selection_pattern = '%(delivery_method)s/' + \
'%(origin)s/' + \
'%(source_protocol)s-%(target_protocol)s/' + \
'%(subresource)s/'
'%(subresource)s/' + \
'%(redirection)s/'

test_file_path_pattern = '%(spec_name)s/' + selection_pattern + \
'%(name)s.%(redirection)s.%(source_protocol)s.html'
'%(name)s.%(source_protocol)s.html'


def get_template(basename):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
<html>
<head>
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
<link rel="author" title="Kristijan Burnik" href="[email protected]">
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
<meta name="assert" content="The referrer URL is stripped-referrer when a
document served over http requires an http
sub-resource via a-tag using the attr-referrer
delivery method with no-redirect and when
the target request is cross-origin.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- TODO(kristijanburnik): Minify and merge both: -->
<script src="/referrer-policy/generic/common.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
</head>
<body>
<script>
ReferrerPolicyTestCase(
{
"referrer_policy": "no-referrer-when-downgrade",
"delivery_method": "attr-referrer",
"redirection": "no-redirect",
"origin": "cross-origin",
"source_protocol": "http",
"target_protocol": "http",
"subresource": "a-tag",
"subresource_path": "/referrer-policy/generic/subresource/document.py",
"referrer_url": "stripped-referrer"
},
document.querySelector("meta[name=assert]").content,
new SanityChecker()
).start();
</script>
<div id="log"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
<html>
<head>
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
<link rel="author" title="Kristijan Burnik" href="[email protected]">
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
<meta name="assert" content="The referrer URL is stripped-referrer when a
document served over http requires an https
sub-resource via a-tag using the attr-referrer
delivery method with no-redirect and when
the target request is cross-origin.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- TODO(kristijanburnik): Minify and merge both: -->
<script src="/referrer-policy/generic/common.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
</head>
<body>
<script>
ReferrerPolicyTestCase(
{
"referrer_policy": "no-referrer-when-downgrade",
"delivery_method": "attr-referrer",
"redirection": "no-redirect",
"origin": "cross-origin",
"source_protocol": "http",
"target_protocol": "https",
"subresource": "a-tag",
"subresource_path": "/referrer-policy/generic/subresource/document.py",
"referrer_url": "stripped-referrer"
},
document.querySelector("meta[name=assert]").content,
new SanityChecker()
).start();
</script>
<div id="log"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
<html>
<head>
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
<link rel="author" title="Kristijan Burnik" href="[email protected]">
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
<meta name="assert" content="The referrer URL is stripped-referrer when a
document served over http requires an http
sub-resource via a-tag using the attr-referrer
delivery method with no-redirect and when
the target request is same-origin.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- TODO(kristijanburnik): Minify and merge both: -->
<script src="/referrer-policy/generic/common.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
</head>
<body>
<script>
ReferrerPolicyTestCase(
{
"referrer_policy": "no-referrer-when-downgrade",
"delivery_method": "attr-referrer",
"redirection": "no-redirect",
"origin": "same-origin",
"source_protocol": "http",
"target_protocol": "http",
"subresource": "a-tag",
"subresource_path": "/referrer-policy/generic/subresource/document.py",
"referrer_url": "stripped-referrer"
},
document.querySelector("meta[name=assert]").content,
new SanityChecker()
).start();
</script>
<div id="log"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
<html>
<head>
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
<link rel="author" title="Kristijan Burnik" href="[email protected]">
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
<meta name="assert" content="The referrer URL is stripped-referrer when a
document served over http requires an https
sub-resource via a-tag using the attr-referrer
delivery method with no-redirect and when
the target request is same-origin.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- TODO(kristijanburnik): Minify and merge both: -->
<script src="/referrer-policy/generic/common.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
</head>
<body>
<script>
ReferrerPolicyTestCase(
{
"referrer_policy": "no-referrer-when-downgrade",
"delivery_method": "attr-referrer",
"redirection": "no-redirect",
"origin": "same-origin",
"source_protocol": "http",
"target_protocol": "https",
"subresource": "a-tag",
"subresource_path": "/referrer-policy/generic/subresource/document.py",
"referrer_url": "stripped-referrer"
},
document.querySelector("meta[name=assert]").content,
new SanityChecker()
).start();
</script>
<div id="log"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
<html>
<head>
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
<!-- No meta: Referrer policy delivered via HTTP headers. -->
<link rel="author" title="Kristijan Burnik" href="[email protected]">
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
<meta name="assert" content="The referrer URL is stripped-referrer when a
document served over http requires an http
sub-resource via a-tag using the http-rp
delivery method with no-redirect and when
the target request is cross-origin.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- TODO(kristijanburnik): Minify and merge both: -->
<script src="/referrer-policy/generic/common.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
</head>
<body>
<script>
ReferrerPolicyTestCase(
{
"referrer_policy": "no-referrer-when-downgrade",
"delivery_method": "http-rp",
"redirection": "no-redirect",
"origin": "cross-origin",
"source_protocol": "http",
"target_protocol": "http",
"subresource": "a-tag",
"subresource_path": "/referrer-policy/generic/subresource/document.py",
"referrer_url": "stripped-referrer"
},
document.querySelector("meta[name=assert]").content,
new SanityChecker()
).start();
</script>
<div id="log"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
<html>
<head>
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
<!-- No meta: Referrer policy delivered via HTTP headers. -->
<link rel="author" title="Kristijan Burnik" href="[email protected]">
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
<meta name="assert" content="The referrer URL is stripped-referrer when a
document served over http requires an https
sub-resource via a-tag using the http-rp
delivery method with no-redirect and when
the target request is cross-origin.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- TODO(kristijanburnik): Minify and merge both: -->
<script src="/referrer-policy/generic/common.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
</head>
<body>
<script>
ReferrerPolicyTestCase(
{
"referrer_policy": "no-referrer-when-downgrade",
"delivery_method": "http-rp",
"redirection": "no-redirect",
"origin": "cross-origin",
"source_protocol": "http",
"target_protocol": "https",
"subresource": "a-tag",
"subresource_path": "/referrer-policy/generic/subresource/document.py",
"referrer_url": "stripped-referrer"
},
document.querySelector("meta[name=assert]").content,
new SanityChecker()
).start();
</script>
<div id="log"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
<html>
<head>
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
<!-- No meta: Referrer policy delivered via HTTP headers. -->
<link rel="author" title="Kristijan Burnik" href="[email protected]">
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
<meta name="assert" content="The referrer URL is stripped-referrer when a
document served over http requires an http
sub-resource via a-tag using the http-rp
delivery method with no-redirect and when
the target request is same-origin.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- TODO(kristijanburnik): Minify and merge both: -->
<script src="/referrer-policy/generic/common.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
</head>
<body>
<script>
ReferrerPolicyTestCase(
{
"referrer_policy": "no-referrer-when-downgrade",
"delivery_method": "http-rp",
"redirection": "no-redirect",
"origin": "same-origin",
"source_protocol": "http",
"target_protocol": "http",
"subresource": "a-tag",
"subresource_path": "/referrer-policy/generic/subresource/document.py",
"referrer_url": "stripped-referrer"
},
document.querySelector("meta[name=assert]").content,
new SanityChecker()
).start();
</script>
<div id="log"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
<html>
<head>
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
<!-- No meta: Referrer policy delivered via HTTP headers. -->
<link rel="author" title="Kristijan Burnik" href="[email protected]">
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
<meta name="assert" content="The referrer URL is stripped-referrer when a
document served over http requires an http
sub-resource via worker-request using the http-rp
delivery method with keep-origin-redirect and when
the target request is same-origin.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- TODO(kristijanburnik): Minify and merge both: -->
<script src="/referrer-policy/generic/common.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
</head>
<body>
<script>
ReferrerPolicyTestCase(
{
"referrer_policy": "no-referrer-when-downgrade",
"delivery_method": "http-rp",
"redirection": "keep-origin-redirect",
"origin": "same-origin",
"source_protocol": "http",
"target_protocol": "http",
"subresource": "worker-request",
"subresource_path": "/referrer-policy/generic/subresource/worker.py",
"referrer_url": "stripped-referrer"
},
document.querySelector("meta[name=assert]").content,
new SanityChecker()
).start();
</script>
<div id="log"></div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using referrer-policy/generic/template/test.release.html.template. -->
<html>
<head>
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
<!-- No meta: Referrer policy delivered via HTTP headers. -->
<link rel="author" title="Kristijan Burnik" href="[email protected]">
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
<meta name="assert" content="The referrer URL is stripped-referrer when a
document served over http requires an http
sub-resource via worker-request using the http-rp
delivery method with no-redirect and when
the target request is same-origin.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- TODO(kristijanburnik): Minify and merge both: -->
<script src="/referrer-policy/generic/common.js"></script>
<script src="/referrer-policy/generic/referrer-policy-test-case.js?pipe=sub"></script>
</head>
<body>
<script>
ReferrerPolicyTestCase(
{
"referrer_policy": "no-referrer-when-downgrade",
"delivery_method": "http-rp",
"redirection": "no-redirect",
"origin": "same-origin",
"source_protocol": "http",
"target_protocol": "http",
"subresource": "worker-request",
"subresource_path": "/referrer-policy/generic/subresource/worker.py",
"referrer_url": "stripped-referrer"
},
document.querySelector("meta[name=assert]").content,
new SanityChecker()
).start();
</script>
<div id="log"></div>
</body>
</html>
Loading

0 comments on commit b6a5f11

Please sign in to comment.