Bug 203789 - Copying reference files in import-w3c-tests breaks when ref files contain references to support files
Summary: Copying reference files in import-w3c-tests breaks when ref files contain ref...
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Sneddon [:gsnedders]
URL:
Keywords: InRadar
Depends on: 203784
Blocks: 207734
  Show dependency treegraph
 
Reported: 2019-11-02 12:32 PDT by Simon Fraser (smfr)
Modified: 2023-07-03 07:14 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2019-11-02 12:32:17 PDT
In css/css-backgrounds, background-image-003.html has a reference of reference/background-image-001-ref.html. We copy reference/background-image-001-ref.html to background-image-003-expected.html, but it has an image resource with a relative URL, and since the copy moved it to a different directory, that relative URL is now broken.

We have to fix bug 203784 and stop copying to -expected.html
Comment 1 Carlos Alberto Lopez Perez 2020-01-27 11:59:37 PST
The WPT test importer detects this and does a rewrite of the relative URL when importing the ref-test.

The tag '<img class="green" src="../support/green.png">' should get updated to '<img class="green" src="support/green.png">' on the generated -expected.html.

Maybe it didn't work for you because the script doesn't do this rewrite if you import from a local source directory.

Example, if you do:

Tools/Scripts/import-w3c-tests -v -s /home/user/local-wpt-checkout css/css-backgrounds -d /home/user/WebKit/LayoutTests/imported/w3c/web-platform-tests

Then it don't do any rewrite

But if you do if you run it like:

Tools/Scripts/import-w3c-tests -t web-platform-tests/css/css-background

Then it will do the rewrites.

TIP: pass also the flag "-v" so you can see if it does the rewrites and if there is any WARNING doing that.

The logic it uses for that seems to be here:

https://trac.webkit.org/browser/webkit/trunk/Tools/Scripts/webkitpy/w3c/test_importer.py?rev=255074#L467


It does a rewrite of the URLs pointed by url(), href= or src= inside <style> tags as well as inside this list of tags: https://trac.webkit.org/browser/webkit/trunk/Tools/Scripts/webkitpy/w3c/test_converter.py?rev=255074#L222


In any case I also think we should fix bug 203784 and stop doing rewrites.
Comment 2 Radar WebKit Bug Importer 2020-09-21 15:39:09 PDT
<rdar://problem/69332145>