Commit 8e4e5d72 authored by Kunihiko Sakamoto's avatar Kunihiko Sakamoto Committed by Commit Bot

Fix preload tests failing on wpt.fyi dashboard

verifyNumberOfDownloads only counts resource timing entries with
transferSize > 0, so it doesn't count if the resource came from a cache.
(See https://bugzilla.mozilla.org/show_bug.cgi?id=1222633#c38 for
background why we have it.)

link-header-preload-nonce.html and link-header-preload-srcset.tentative.html
were failing on wpt.fyi dashboard because they have used the same
subresource URLs as other tests, and preloaded resources from the disk
cache.

This patch adds unique query parameters to these URLs so that they don't
conflict with other tests.

Bug: 922343
Change-Id: I7fd88530f5fdd83ed2a22d2e2893cc446debd036
Reviewed-on: https://chromium-review.googlesource.com/c/1411963Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623157}
parent fe595425
......@@ -9,8 +9,8 @@
<script nonce="abc">
window.addEventListener('load', t.step_func(function() {
verifyPreloadAndRTSupport();
verifyNumberOfDownloads("resources/dummy.js?without-nonce", 0);
verifyNumberOfDownloads("resources/dummy.js?with-nonce", 1);
verifyNumberOfDownloads("resources/dummy.js?from-header&without-nonce", 0);
verifyNumberOfDownloads("resources/dummy.js?from-header&with-nonce", 1);
t.done();
}));
</script>
Content-Security-Policy: script-src 'nonce-abc'
Link: </preload/resources/dummy.js?without-nonce>;rel=preload;as=script
Link: </preload/resources/dummy.js?with-nonce>;rel=preload;as=script;nonce=abc
Link: </preload/resources/dummy.js?from-header&without-nonce>;rel=preload;as=script
Link: </preload/resources/dummy.js?from-header&with-nonce>;rel=preload;as=script;nonce=abc
......@@ -11,16 +11,16 @@
<script>
window.addEventListener("load", t.step_func(function() {
verifyPreloadAndRTSupport();
verifyNumberOfDownloads('resources/square.png?1x', 1);
verifyNumberOfDownloads('resources/square.png?2x', 0);
verifyNumberOfDownloads('resources/square.png?3x', 0);
verifyNumberOfDownloads('resources/square.png?base', 0);
verifyNumberOfDownloads('resources/square.png?200', 0);
verifyNumberOfDownloads('resources/square.png?400', 1);
verifyNumberOfDownloads('resources/square.png?800', 0);
verifyNumberOfDownloads('resources/square.png?150', 0);
verifyNumberOfDownloads('resources/square.png?300', 1);
verifyNumberOfDownloads('resources/square.png?600', 0);
verifyNumberOfDownloads('resources/square.png?from-header&1x', 1);
verifyNumberOfDownloads('resources/square.png?from-header&2x', 0);
verifyNumberOfDownloads('resources/square.png?from-header&3x', 0);
verifyNumberOfDownloads('resources/square.png?from-header&base', 0);
verifyNumberOfDownloads('resources/square.png?from-header&200', 0);
verifyNumberOfDownloads('resources/square.png?from-header&400', 1);
verifyNumberOfDownloads('resources/square.png?from-header&800', 0);
verifyNumberOfDownloads('resources/square.png?from-header&150', 0);
verifyNumberOfDownloads('resources/square.png?from-header&300', 1);
verifyNumberOfDownloads('resources/square.png?from-header&600', 0);
t.done();
}));
</script>
......
Link: <resources/square.png?1x>; rel=preload; as=image; imagesrcset="resources/square.png?2x 2x, resources/square.png?3x 3x"
Link: <resources/square.png?base>; rel=preload; as=image; imagesrcset="resources/square.png?200 200w, resources/square.png?400 400w, resources/square.png?800 800w"; imagesizes=400px
Link: <resources/square.png?base>; rel=preload; as=image; imagesrcset="resources/square.png?150 150w, resources/square.png?300 300w, resources/square.png?600 600w"; imagesizes="(min-width: 300px) 300px, 150px"
Link: <resources/square.png?from-header&1x>; rel=preload; as=image; imagesrcset="resources/square.png?from-header&2x 2x, resources/square.png?from-header&3x 3x"
Link: <resources/square.png?from-header&base>; rel=preload; as=image; imagesrcset="resources/square.png?from-header&200 200w, resources/square.png?from-header&400 400w, resources/square.png?from-header&800 800w"; imagesizes=400px
Link: <resources/square.png?from-header&base>; rel=preload; as=image; imagesrcset="resources/square.png?from-header&150 150w, resources/square.png?from-header&300 300w, resources/square.png?from-header&600 600w"; imagesizes="(min-width: 300px) 300px, 150px"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment