Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(669)

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/preload/onerror-event.html

Issue 2903653005: [preload] Mandatory `as` value and related spec alignments (Closed)
Patch Set: IDL changes Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head></head> 3 <head></head>
4 <body> 4 <body>
5 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script> 6 <script src="/resources/testharnessreport.js"></script>
7 <script src="/preload/resources/preload_helper.js"></script> 7 <script src="/preload/resources/preload_helper.js"></script>
8 <script> 8 <script>
9 var t = async_test('Makes sure that preloaded resources trigger the onerror event'); 9 var t = async_test('Makes sure that preloaded resources trigger the onerror event');
10 var scriptFailed = false; 10 var scriptFailed = false;
11 var styleFailed = false; 11 var styleFailed = false;
12 var imageFailed = false; 12 var imageFailed = false;
13 var fontFailed = false; 13 var fontFailed = false;
14 var videoFailed = false; 14 var videoFailed = false;
15 var audioFailed = false; 15 var audioFailed = false;
16 var trackFailed = false; 16 var trackFailed = false;
17 var gibberishFailed = false; 17 var gibberishFailed = false;
18 var noTypeFailed = false; 18 var fetchFailed = false;
19 var emptyFailed = false;
19 </script> 20 </script>
20 <link rel=preload href="non-existent/dummy.js" as=script onerror="scriptFailed = true;"> 21 <link rel=preload href="non-existent/dummy.js" as=script onerror="scriptFailed = true;">
21 <link rel=preload href="non-existent/dummy.css" as=style onerror="styleFailed = true;"> 22 <link rel=preload href="non-existent/dummy.css" as=style onerror="styleFailed = true;">
22 <link rel=preload href="non-existent/square.png" as=image onerror="imageFailed = true;"> 23 <link rel=preload href="non-existent/square.png" as=image onerror="imageFailed = true;">
23 <link rel=preload href="non-existent/Ahem.ttf" as=font crossorigin onerror="font Failed = true;"> 24 <link rel=preload href="non-existent/Ahem.ttf" as=font crossorigin onerror="font Failed = true;">
24 <link rel=preload href="non-existent/test.mp4" as=video onerror="videoFailed = t rue;"> 25 <link rel=preload href="non-existent/test.mp4" as=video onerror="videoFailed = t rue;">
25 <link rel=preload href="non-existent/test.oga" as=audio onerror="audioFailed = t rue;"> 26 <link rel=preload href="non-existent/test.oga" as=audio onerror="audioFailed = t rue;">
26 <link rel=preload href="non-existent/security/captions.vtt" as=track onerror="tr ackFailed = true;"> 27 <link rel=preload href="non-existent/security/captions.vtt" as=track onerror="tr ackFailed = true;">
27 <link rel=preload href="non-existent/dummy.xml" as=foobarxmlthing onerror="gibbe rishFailed = true;"> 28 <link rel=preload href="non-existent/dummy.xml?foo" as=foobarxmlthing onerror="g ibberishFailed = true;">
28 <link rel=preload href="non-existent/dummy.xml" onerror="noTypeFailed = true;"> 29 <link rel=preload href="non-existent/dummy.xml?fetch" as=fetch onerror="fetchFai led = true;">
30 <link rel=preload href="non-existent/dummy.xml?empty" onerror="emptyFailed = tru e;">
29 <script src="resources/dummy.js?pipe=trickle(d5)"></script> 31 <script src="resources/dummy.js?pipe=trickle(d5)"></script>
30 <script> 32 <script>
31 window.onload = t.step_func(function() { 33 window.onload = t.step_func(function() {
32 verifyPreloadAndRTSupport(); 34 verifyPreloadAndRTSupport();
33 assert_true(styleFailed, "style triggered error event"); 35 assert_true(styleFailed, "style triggered error event");
34 assert_true(scriptFailed, "script triggered error event"); 36 assert_true(scriptFailed, "script triggered error event");
35 assert_true(imageFailed, "image triggered error event"); 37 assert_true(imageFailed, "image triggered error event");
36 assert_true(fontFailed, "font triggered error event"); 38 assert_true(fontFailed, "font triggered error event");
37 assert_true(videoFailed, "video triggered error event"); 39 assert_true(videoFailed, "video triggered error event");
38 assert_true(audioFailed, "audio triggered error event"); 40 assert_true(audioFailed, "audio triggered error event");
39 assert_true(trackFailed, "track triggered error event"); 41 assert_true(trackFailed, "track triggered error event");
40 assert_true(gibberishFailed, "gibberish as value triggered error event") ; 42 assert_false(gibberishFailed, "gibberish as value did not trigger error event");
41 assert_true(noTypeFailed, "empty as triggered error event"); 43 assert_true(fetchFailed, "fetch as triggered error event");
44 assert_false(emptyFailed, "empty as triggered error event");
42 t.done(); 45 t.done();
43 }); 46 });
44 </script> 47 </script>
45 </body> 48 </body>
46 </html> 49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698