Skip to content

Commit

Permalink
Start running the parsed file lints against support files
Browse files Browse the repository at this point in the history
This is largely motivated by ensuring that people aren't including
testharnessreport.js in support files which are then included via
fetch_tests_from_window, and most of the files changed here are
removing redundant inclusions here.

We also find a few other errors, such as testdriver-vendor.js being
omitted and invalid values for <meta name=timeout>, which are also
fixed.

Finally, add a few things to the allowlist.
  • Loading branch information
gsnedders committed Sep 25, 2024
1 parent 754fa51 commit f6f4163
Show file tree
Hide file tree
Showing 143 changed files with 47 additions and 143 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Protocol Handling Web Platform Test - Pass</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
setup({ single_test: true });
const urlParams = new URLSearchParams(window.location.search);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="util.js"></script>
<script>
sandbox_popup_listener("/client-hints/resources/expect-client-hints-headers.html");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="util.js"></script>
<script>
sandbox_popup_listener("/client-hints/resources/expect-no-client-hints-headers.html");
Expand Down
1 change: 0 additions & 1 deletion compute-pressure/resources/support-iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<meta charset="utf-8">
<title>compute pressure iframe tester</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async function messageHandler(e) {
if (e.data.command === 'start') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<body>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
<script src='/content-security-policy/frame-ancestors/support/frame-ancestors-test.sub.js'></script>

<span id="escape">{{GET[policy]}}</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<span id="escape">{{GET[window_url]}}</span>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Test site embedded in a cross-site context</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="/cookies/resources/cookie-helper.sub.js"></script>
<script src="/cookies/partitioned-cookies/resources/test-helpers.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Test partitioned cookie top level cross-site</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="/cookies/resources/cookie-helper.sub.js"></script>
<script src="/cookies/partitioned-cookies/resources/test-helpers.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<meta name="timeout" content="long">
<title>Test site embedded in a cross-site context</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="/cookies/resources/cookie-helper.sub.js"></script>
<script src="/cookies/third-party-cookies/resources/test-helpers.js"></script>
Expand Down
1 change: 0 additions & 1 deletion fenced-frame/resources/automatic-beacon-unfenced-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<title>Page navigated to by an _unfencedTop navigation</title>

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>
<script src="/common/get-host-info.sub.js"></script>

Expand Down
1 change: 0 additions & 1 deletion fenced-frame/resources/background-fetch-inner.https.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>
<title>Fenced frame content to report the result of background fetch</title>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>
<title>Fenced frame content to report the result of background fetch in SW</title>

Expand Down
1 change: 0 additions & 1 deletion fenced-frame/resources/background-sync-inner.https.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>
<title>Fenced frame content to report the result of background sync's register</title>

Expand Down
1 change: 0 additions & 1 deletion fenced-frame/resources/background-sync-sw-inner.https.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>
<title>Fenced frame content to report the result of background sync's register in SW</title>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<title>child frame with delayed onload event</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>

<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<title>Navigate ancestor helper</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>

<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<title>Navigate ancestor helper from nested fenced frame</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>

<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<title>Test navigating an ancestor frame from within a fenced frame</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>

<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<title>Fenced frame content to report the result of navigator.geolocation.getCurrentPosition()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="utils.js"></script>
Expand Down
1 change: 0 additions & 1 deletion fenced-frame/resources/window-navigation-204-inner.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>
<title>Fenced frame content to report the value of window.navigation</title>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>about:blank Network Partition Checker</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#network-partition-keys">
<meta name="timeout" content="normal">
</head>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Network Partition Checker</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#network-partition-keys">
<meta name="timeout" content="normal">
<script src="SUBRESOURCE_PREFIX:&dispatch=fetch_file&path=common/utils.js"></script>
<script src="SUBRESOURCE_PREFIX:&dispatch=fetch_file&path=resources/testharness.js"></script>
<script src="SUBRESOURCE_PREFIX:&dispatch=fetch_file&path=fetch/connection-pool/resources/network-partition-key.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Iframe Network Partition Checker</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#network-partition-keys">
<meta name="timeout" content="normal">
<script src="SUBRESOURCE_PREFIX:&dispatch=fetch_file&path=common/utils.js"></script>
<script src="SUBRESOURCE_PREFIX:&dispatch=fetch_file&path=resources/testharness.js"></script>
<script src="SUBRESOURCE_PREFIX:&dispatch=fetch_file&path=fetch/connection-pool/resources/network-partition-key.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>Worker Network Partition Checker</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#network-partition-keys">
<meta name="timeout" content="normal">
<script src="SUBRESOURCE_PREFIX:&dispatch=fetch_file&path=common/utils.js"></script>
<script src="SUBRESOURCE_PREFIX:&dispatch=fetch_file&path=resources/testharness.js"></script>
<script src="SUBRESOURCE_PREFIX:&dispatch=fetch_file&path=fetch/connection-pool/resources/network-partition-key.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>HTTP Cache - helper</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#http-cache-partitions">
<meta name="timeout" content="normal">
<script src="/resources/testharness.js"></script>
<script src="/common/get-host-info.sub.js"></script>
</head>
Expand Down
1 change: 0 additions & 1 deletion fetch/http-cache/resources/split-cache-popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>HTTP Cache - helper</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#http-cache-partitions">
<meta name="timeout" content="normal">
<script src="/resources/testharness.js"></script>
<script src="../http-cache.js"></script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<title>Focus event inner document</title>
</head>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<body>
<h1>Inner</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<title>pagereveal event fires and in correct order on prerender activation (popup)</title>
<link rel="author" href="mailto:[email protected]">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/speculation-rules/prerender/resources/utils.js"></script>
<script>
const params = new URLSearchParams(location.search);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="./intersection-observer-test-utils.js"></script>

<style>
Expand Down
33 changes: 33 additions & 0 deletions lint.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ AHEM COPY: fonts/Ahem.ttf
# None of these are actually Ahem
AHEM COPY: fonts/ahem-extra/AHEM_*.TTF

## Ignore the testharness.js unit tests
INVALID-TIMEOUT: resources/test/*
TESTHARNESS-PATH: resources/test/*
TESTHARNESSREPORT-IN-UNSUPPORTED-TYPE: resources/test/*
TESTHARNESSREPORT-PATH: resources/test/*

## Test exclusions ##

# Intentional use of CRLF
Expand Down Expand Up @@ -138,6 +144,12 @@ PARSE-FAILED: dom/nodes/Document-createElement-namespace-tests/minimal_html.xhtm
PARSE-FAILED: dom/nodes/Document-createElement-namespace-tests/minimal_html.xml
PARSE-FAILED: custom-elements/xhtml-crash.xhtml

# Files that don't parse because UTF-32 support is gone
PARSE-FAILED: encoding/resources/utf-32-little-endian-nobom.xml
PARSE-FAILED: encoding/resources/utf-32-little-endian-bom.xml
PARSE-FAILED: encoding/resources/utf-32-big-endian-nobom.xml
PARSE-FAILED: encoding/resources/utf-32-big-endian-bom.xml

# setTimeout usage (should probably mostly be fixed)
SET TIMEOUT: *-manual.*
SET TIMEOUT: annotation-model/scripts/ajv.min.js
Expand Down Expand Up @@ -461,6 +473,18 @@ INDENT TABS: css/mediaqueries/*
INDENT TABS: css/selectors/*
INDENT TABS: css/WOFF2/*

## Templates can deal with certain things being wrong; we only care about the output
INVALID-TIMEOUT: */templates/*
NON-EXISTENT-REF: */*-template.html
NON-EXISTENT-REF: */templates/*
NON-EXISTENT-REF: css/css-images/tools/template-object-fit-test.html
NON-EXISTENT-REF: css/css-images/tools/template-object-position-test.html
REFERENCE-IN-OTHER-TYPE: */*-template.html
REFERENCE-IN-OTHER-TYPE: */templates/*
REFERENCE-IN-OTHER-TYPE: css/css-images/tools/template-object-fit-test.html
REFERENCE-IN-OTHER-TYPE: css/css-images/tools/template-object-position-test.html
TESTHARNESSREPORT-IN-UNSUPPORTED-TYPE: */templates/*
TESTHARNESSREPORT-IN-UNSUPPORTED-TYPE: css/css-writing-modes/tools/generators/template.html

## Things we're stopping from getting worse
CONSOLE: css/css-shapes/shape-outside/supported-shapes/support/test-utils.js
Expand Down Expand Up @@ -818,3 +842,12 @@ TESTDRIVER-IN-UNSUPPORTED-TYPE: payment-handler/change-shipping-option-manual.ht
TESTDRIVER-IN-UNSUPPORTED-TYPE: payment-handler/payment-request-event-manual.https.html
TESTDRIVER-IN-UNSUPPORTED-TYPE: payment-handler/supports-shipping-contact-delegation-manual.https.html
TESTDRIVER-IN-UNSUPPORTED-TYPE: shadow-dom/crashtests/move-to-new-tree-1343016.html

# Intentional use of testharness.js with an absolute URL
TESTHARNESS-PATH: fetch/connection-pool/resources/network-partition-checker.html
TESTHARNESS-PATH: fetch/connection-pool/resources/network-partition-iframe-checker.html
TESTHARNESS-PATH: fetch/connection-pool/resources/network-partition-worker-checker.html

# View Transitions tests include references relative to the original test URL
NON-EXISTENT-REF: css/css-view-transitions/navigation/resources/*
REFERENCE-IN-OTHER-TYPE: css/css-view-transitions/navigation/resources/*
1 change: 0 additions & 1 deletion loading/early-hints/resources/404-with-early-hints.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
promise_test(async (t) => {
Expand Down
1 change: 0 additions & 1 deletion loading/early-hints/resources/coep-mismatch.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
1 change: 0 additions & 1 deletion loading/early-hints/resources/csp-basic.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
1 change: 0 additions & 1 deletion loading/early-hints/resources/csp-document-disallow.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<meta charset=utf-8>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
1 change: 0 additions & 1 deletion loading/early-hints/resources/preload-as-test.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
1 change: 0 additions & 1 deletion loading/early-hints/resources/preload-fetch.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
1 change: 0 additions & 1 deletion loading/early-hints/resources/preload-fetchpriority.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="early-hints-helpers.sub.js"></script>
<body>
<script>
Expand Down
Loading

0 comments on commit f6f4163

Please sign in to comment.