Skip to content

Commit

Permalink
Fix slow stylesheet test
Browse files Browse the repository at this point in the history
Script blocking sheet does not need timeout since tests will not run
until the sheet loads anyway. Href on modified link should not need a
large delay since the test happens in the script immediately after
setting the href.

Bug: 1245034
Change-Id: Ieee7fd7137046b23a4c2f0039df982e9bec888c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3147711
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#919307}
  • Loading branch information
Rune Lillesveen authored and chromium-wpt-export-bot committed Sep 8, 2021
1 parent f501636 commit bf08701
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<link rel="help" href="https://html.spec.whatwg.org/multipage/links.html#link-type-stylesheet">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link href="style.css?pipe=trickle(d3)" rel="stylesheet" id="style_test">
<link href="style.css" rel="stylesheet" id="style_test">
<script>
test(function() {
assert_true(document.styleSheets.length === 1 &&
document.styleSheets[0].href.includes("style.css"),
"The style sheet 'style.css' must be available to scripts");

style_test.href = "resources/neutral.css?pipe=trickle(d3)";
style_test.href = "resources/neutral.css?pipe=trickle(d1)";

assert_true(document.styleSheets.length === 1 &&
document.styleSheets[0].href.includes("style.css"),
Expand Down

0 comments on commit bf08701

Please sign in to comment.