forked from mykmelez/gecko
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1597354 [wpt PR 20301] - Test for link element firing multiple ev…
…ents, a=testonly Automatic update from web-platform-tests Test for link element firing multiple events (#20301) -- wpt-commits: ee893908a206f562a35f202fce67e667bc19f603 wpt-pr: 20301
- Loading branch information
1 parent
46d2d6d
commit 253fe01
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...m/tests/html/semantics/document-metadata/the-link-element/link-multiple-error-events.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<link rel="author" title="Dom Farolino" href="mailto:dom@chromium.org"> | ||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<link id=style_link rel=stylesheet> | ||
<script> | ||
async_test(t => { | ||
const link = document.querySelector('#style_link'); | ||
link.onload = t.unreached_func('Sheet should fail to load'); | ||
link.onerror = t.step_func(() => { | ||
link.onerror = t.step_func_done(() => {}); | ||
link.href = 'nonexistent.css?second'; | ||
}); | ||
|
||
link.href = 'nonexistent.css?first'; | ||
}, "Check if the <link>'s error event fires for each stylesheet it fails to load"); | ||
|
||
</script> | ||
</head> | ||
</html> |
21 changes: 21 additions & 0 deletions
21
...rm/tests/html/semantics/document-metadata/the-link-element/link-multiple-load-events.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<link rel="author" title="Dom Farolino" href="mailto:dom@chromium.org"> | ||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<link id=style_link rel=stylesheet> | ||
<script> | ||
async_test(t => { | ||
const link = document.querySelector('#style_link'); | ||
link.onerror = t.unreached_func('Sheet should load successfully'); | ||
link.onload = t.step_func(() => { | ||
link.onload = t.step_func_done(() => {}); | ||
link.href = 'style.css?second'; | ||
}); | ||
|
||
link.href = 'style.css?first'; | ||
|
||
}, "Check if the <link>'s load event fires for each stylesheet it loads"); | ||
</script> | ||
</head> | ||
</html> |