Commit graph

15 commits

Author SHA1 Message Date
Tim Ledbetter
f8dacdaf50 Meta: Strip extraneous slashes from file paths in the WPT importer
Previously attempting to import files with a `src` that had a leading
`/` would fail.
2024-12-29 00:50:55 +00:00
Tim Ledbetter
5c032583b4 Meta: Ensure rel attribute exists before querying its value
Previously, the WPT importer would fail to import files with link tags
that didn't have a `rel` attribute.
2024-12-23 11:53:37 +00:00
Lucas CHOLLET
2b56a53d41 Meta: Also download support files of WPT tests' reference pages 2024-12-19 09:54:14 +00:00
Lucas CHOLLET
cc76225c1f Meta: Refactor map_to_path() to use a basic loop 2024-12-19 09:54:14 +00:00
Lucas CHOLLET
ccb4c205cd Meta: Remove one global variable in the wpt import script 2024-12-19 09:54:14 +00:00
Lucas CHOLLET
325d1bb853 Meta: Download support images along their respective WPT tests 2024-12-19 09:54:14 +00:00
Tim Ledbetter
9c63785d0f Meta: Disallow importing ref tests with multiple match or mismatch links
Our internal test runner does not currently support this, so let's
explicitly disallow it for now to avoid potential confusion.
2024-12-04 19:50:00 +00:00
Tim Ledbetter
e059ac6a1a Meta: Allow importing WPT ref tests with mismatch conditions
Previously, ref tests with mismatch conditions were misclassified as
text tests.
2024-12-04 19:50:00 +00:00
Sam Atkins
f2407cd511 Meta: Support importing WPT ref tests that use an absolute path
For example, a few ref tests have a match like this:
```
<link rel="match"
      href="/css/reference/ref-filled-green-100px-square-only.html">
```

Previously we'd interpret this as `http://css/reference/...` which made
the test runner sad.
2024-11-06 20:03:38 +01:00
Sam Atkins
8673dd4e6e Meta: Include stylesheets and stylesheet-includes in WPT imports
Because of this we no longer have to handle ahem.css in a special way.

This should find:
- <link rel=stylesheet>
- CSS `@import`s
- Any resources linked from a stylesheet with `url()`

There's a good chance there are other resources we'll want to copy too,
but CSS was a big hole.
2024-11-06 20:03:38 +01:00
Sam Atkins
7a5b38d577 Meta: Support importing WPT reference tests 2024-11-05 17:58:16 +00:00
Aliaksandr Kalenik
3833049fc8 Meta+Tests: Substitute Ahem font path in import-wpt-test.py 2024-11-05 17:44:08 +01:00
sideshowbarker
286511c4cf Meta: Make import-wpt-test.py use html.parser, not BeautifulSoup
This change switches the Meta/import-wpt-test.py script to using the
standard html.parser module rather than BeautifulSoup.

Otherwise, without this change, when a contributor first tries to run
the script, if they don’t have BeautifulSoup installed, it will fail.

Note that this patch also includes an unrelated small change that
switches to using os.path.normpath — rather than Path.absolute() — to
“normalize” the destination names of the downloaded test files.
2024-11-01 12:27:24 +01:00
sideshowbarker
cf7a1f6a52 Meta: Make import-wpt-test.py resolve “..” parent refs in URLs/pathnames
This change makes the Meta/import-wpt-test.py script handle URLs such as
https://wpt.live//WebCryptoAPI/generateKey/../util/helpers.js and paths
containing, e.g., wpt-import/WebCryptoAPI/generateKey/../util/helpers.js
(that is, URLs and paths with “..” parent-directory references in them).

Otherwise, without this change, when the import-wpt-test.py script tries
a URL like https://wpt.live//WebCryptoAPI/generateKey/../util/helpers.js
which contains a “..” parent-directory reference, the script fails with
a “urllib.error.HTTPError: HTTP Error 404: Not Found” error message.
2024-10-31 07:04:18 +00:00
stelar7
5630a0d6b4 Meta: Add a script to import WPT tests 2024-10-30 17:29:03 +01:00