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

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

Issue 2732853003: [preload] Split up media into video, audio and track (Closed)
Patch Set: Added a test that media fails Created 3 years, 9 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 noTypeFailed = false;
19 </script> 19 </script>
20 <link rel=preload href="non-existent/dummy.js" as=script onerror="scriptFailed = true;"> 20 <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;"> 21 <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;"> 22 <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;"> 23 <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;"> 24 <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;"> 25 <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=media onerror="tr ackFailed = true;"> 26 <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;"> 27 <link rel=preload href="non-existent/dummy.xml" as=foobarxmlthing onerror="gibbe rishFailed = true;">
28 <link rel=preload href="non-existent/dummy.xml" onerror="noTypeFailed = true;"> 28 <link rel=preload href="non-existent/dummy.xml" onerror="noTypeFailed = true;">
29 <script src="resources/dummy.js?pipe=trickle(d5)"></script> 29 <script src="resources/dummy.js?pipe=trickle(d5)"></script>
30 <script> 30 <script>
31 window.onload = t.step_func(function() { 31 window.onload = t.step_func(function() {
32 verifyPreloadAndRTSupport(); 32 verifyPreloadAndRTSupport();
33 assert_true(styleFailed, "style triggered error event"); 33 assert_true(styleFailed, "style triggered error event");
34 assert_true(scriptFailed, "script triggered error event"); 34 assert_true(scriptFailed, "script triggered error event");
35 assert_true(imageFailed, "image triggered error event"); 35 assert_true(imageFailed, "image triggered error event");
36 assert_true(fontFailed, "font triggered error event"); 36 assert_true(fontFailed, "font triggered error event");
37 assert_true(videoFailed, "video triggered error event"); 37 assert_true(videoFailed, "video triggered error event");
38 assert_true(audioFailed, "audio triggered error event"); 38 assert_true(audioFailed, "audio triggered error event");
39 assert_true(trackFailed, "track triggered error event"); 39 assert_true(trackFailed, "track triggered error event");
40 assert_true(gibberishFailed, "gibberish as value triggered error event") ; 40 assert_true(gibberishFailed, "gibberish as value triggered error event") ;
41 assert_true(noTypeFailed, "empty as triggered error event"); 41 assert_true(noTypeFailed, "empty as triggered error event");
42 t.done(); 42 t.done();
43 }); 43 });
44 </script> 44 </script>
45 </body> 45 </body>
46 </html> 46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698