mirror of
https://github.com/servo/servo.git
synced 2025-08-29 00:58:20 +01:00
Update web-platform-tests to revision d7afcb8708eac08a614d161d5622a48172daf7e3
This commit is contained in:
parent
6f8bb4dd40
commit
edff458e23
791 changed files with 17647 additions and 10322 deletions
|
@ -1,20 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Makes sure that preloaded resources trigger the onload event</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/preload/resources/preload_helper.js"></script>
|
||||
<script>
|
||||
var t = async_test('Makes sure that preloaded resources trigger the onload event');
|
||||
var scriptLoaded = false;
|
||||
var styleLoaded = false;
|
||||
var imageLoaded = false;
|
||||
var fontLoaded = false;
|
||||
var videoLoaded = false;
|
||||
var audioLoaded = false;
|
||||
var trackLoaded = false;
|
||||
var gibberishLoaded = false;
|
||||
var gibberishErrored = false;
|
||||
var noTypeLoaded = false;
|
||||
var fetchLoaded = false;
|
||||
var scriptLoaded = false;
|
||||
var styleLoaded = false;
|
||||
var imageLoaded = false;
|
||||
var fontLoaded = false;
|
||||
var videoLoaded = false;
|
||||
var audioLoaded = false;
|
||||
var trackLoaded = false;
|
||||
var gibberishLoaded = false;
|
||||
var gibberishErrored = false;
|
||||
var noTypeLoaded = false;
|
||||
var fetchLoaded = false;
|
||||
</script>
|
||||
<link rel=preload href="resources/dummy.js" as=script onload="scriptLoaded = true;">
|
||||
<link rel=preload href="resources/dummy.css" as=style onload="styleLoaded = true;">
|
||||
|
@ -28,22 +28,38 @@
|
|||
<link rel=preload href="resources/dummy.xml" onload="noTypeLoaded = true;">
|
||||
<body>
|
||||
<script>
|
||||
window.onload = t.step_func(function() {
|
||||
t.step_timeout(function() {
|
||||
verifyPreloadAndRTSupport();
|
||||
assert_true(styleLoaded, "style triggered load event");
|
||||
assert_true(scriptLoaded, "script triggered load event");
|
||||
assert_true(imageLoaded, "image triggered load event");
|
||||
assert_true(fontLoaded, "font triggered load event");
|
||||
assert_true(videoLoaded, "video triggered load event");
|
||||
assert_true(audioLoaded, "audio triggered load event");
|
||||
assert_true(trackLoaded, "track triggered load event");
|
||||
assert_false(gibberishLoaded, "gibberish as value triggered load event");
|
||||
assert_false(gibberishErrored, "gibberish as value triggered error event");
|
||||
assert_true(fetchLoaded, "fetch as value triggered load event");
|
||||
assert_false(noTypeLoaded, "empty as triggered load event");
|
||||
t.done();
|
||||
}, 5000);
|
||||
});
|
||||
setup({explicit_done: true});
|
||||
|
||||
var iterations = 0;
|
||||
|
||||
function check_finished() {
|
||||
if (styleLoaded && scriptLoaded && imageLoaded && fontLoaded && videoLoaded && audioLoaded &&
|
||||
trackLoaded && !gibberishLoaded && !gibberishErrored && fetchLoaded && !noTypeLoaded) {
|
||||
done();
|
||||
}
|
||||
iterations++;
|
||||
if (iterations == 10) {
|
||||
// At least one is expected to fail, but this should give details to the exact failure(s).
|
||||
assert_true(styleLoaded, "style triggered load event");
|
||||
assert_true(scriptLoaded, "script triggered load event");
|
||||
assert_true(imageLoaded, "image triggered load event");
|
||||
assert_true(fontLoaded, "font triggered load event");
|
||||
assert_true(videoLoaded, "video triggered load event");
|
||||
assert_true(audioLoaded, "audio triggered load event");
|
||||
assert_true(trackLoaded, "track triggered load event");
|
||||
assert_false(gibberishLoaded, "gibberish as value triggered load event");
|
||||
assert_false(gibberishErrored, "gibberish as value triggered error event");
|
||||
assert_true(fetchLoaded, "fetch as value triggered load event");
|
||||
assert_false(noTypeLoaded, "empty as triggered load event");
|
||||
done();
|
||||
} else {
|
||||
step_timeout(check_finished, 500);
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
verifyPreloadAndRTSupport();
|
||||
step_timeout(check_finished, 0);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue