OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head></head> | |
4 <body> | |
5 <script src="../resources/testharness.js"></script> | |
6 <script src="../resources/testharnessreport.js"></script> | |
7 <script> | |
8 var t = async_test('Makes sure that preloaded resources trigger the onload e
vent'); | |
9 var scriptLoaded = false; | |
10 var styleLoaded = false; | |
11 var imageLoaded = false; | |
12 var fontLoaded = false; | |
13 var videoLoaded = false; | |
14 var audioLoaded = false; | |
15 var trackLoaded = false; | |
16 var gibberishLoaded = false; | |
17 var gibberishErrored = false; | |
18 var noTypeLoaded = false; | |
19 </script> | |
20 <link rel=preload href="../resources/dummy.js" as=script onload="scriptLoaded =
true;"> | |
21 <link rel=preload href="../resources/dummy.css" as=style onload="styleLoaded = t
rue;"> | |
22 <link rel=preload href="../resources/square.png" as=image onload="imageLoaded =
true;"> | |
23 <link rel=preload href="../resources/Ahem.ttf" as=font crossorigin onload="fontL
oaded = true;"> | |
24 <link rel=preload href="../resources/test.mp4" as=media onload="videoLoaded = tr
ue;"> | |
25 <link rel=preload href="../resources/test.oga" as=media onload="audioLoaded = tr
ue;"> | |
26 <link rel=preload href="../security/resources/captions.vtt" as=track onload="tra
ckLoaded = true;"> | |
27 <link rel=preload href="../resources/dummy.xml" as=foobarxmlthing onload="gibber
ishLoaded = true;" onerror="gibberishErrored = true;"> | |
28 <link rel=preload href="../resources/dummy.xml" onload="noTypeLoaded = true;"> | |
29 <script src="../resources/slow-script.pl?delay=500"></script> | |
30 <script> | |
31 window.onload = t.step(function(){ | |
32 assert_true(styleLoaded, "style triggered load event"); | |
33 assert_true(scriptLoaded, "script triggered load event"); | |
34 assert_true(imageLoaded, "image triggered load event"); | |
35 assert_true(fontLoaded, "font triggered load event"); | |
36 assert_true(videoLoaded, "video triggered load event"); | |
37 assert_true(audioLoaded, "audio triggered load event"); | |
38 assert_true(trackLoaded, "track triggered load event"); | |
39 assert_false(gibberishLoaded, "gibberish as value triggered load event")
; | |
40 assert_true(gibberishErrored, "gibberish as value triggered error event"
); | |
41 assert_true(noTypeLoaded, "empty as triggered load event"); | |
42 t.done(); | |
43 }); | |
44 </script> | |
45 </body> | |
46 </html> | |
OLD | NEW |