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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/media-src/media-src-7_1_2.html

Issue 2766913003: Fixed and improved content-security-policy/media-src tests (Closed)
Patch Set: 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> 3 <head>
4 <title>Video element src attribute must match src list - negative test</titl e> 4 <title>Video element src attribute must match src list - negative test</titl e>
5 <meta name=timeout content=long> 5 <meta name=timeout content=long>
6 <script src='/resources/testharness.js'></script> 6 <script src='/resources/testharness.js'></script>
7 <script src='/resources/testharnessreport.js'></script> 7 <script src='/resources/testharnessreport.js'></script>
8 </head> 8 </head>
9 <body> 9 <body>
10 <h1>Video element src attribute must match src list - negative test</h1> 10 <h1>Video element src attribute must match src list - negative test</h1>
11 <div id='log'></div> 11 <div id='log'></div>
12 12
13 <script> 13 <script>
14 var src_test = async_test("Disallowed async video src"); 14 var src_test = async_test("Disallowed async video src");
15 var source_test = async_test("Disallowed async video source element"); 15 var source_test = async_test("Disallowed async video source element");
16 16
17 // we assume tests are run from 'hostname' and 'www.hostname' or 'www2.hos tname' is a valid alias 17 // we assume tests are run from 'hostname' and 'www.hostname' or 'www2.hos tname' is a valid alias
18 var mediaURL = location.protocol + 18 var mediaURL = location.protocol +
19 "//www2." + 19 "//www2." +
20 location.hostname + 20 location.hostname +
21 ":" + 21 ":" +
22 location.port + 22 location.port +
23 "/media/white.mp4"; 23 "/media/A4.ogv";
24 24
25 function media_loaded(t) { 25 function media_loaded(t) {
26 t.step( function () { 26 t.step( function () {
27 assert_unreached("Media error handler should be triggered for non-allo wed domain."); 27 assert_unreached("Media error handler should be triggered for non-allo wed domain.");
28 }); 28 });
29 t.done(); 29 t.done();
30 } 30 }
31 31
32 function media_error_handler(t) { 32 function media_error_handler(t) {
33 t.done(); 33 t.done();
34 } 34 }
35 </script> 35 </script>
36 36
37 <video id="videoObject" width="320" height="240" controls 37 <video id="videoObject" width="320" height="240" controls
38 onloadeddata="media_loaded(source_test)"> 38 onloadeddata="media_loaded(source_test)">
39 <source id="videoSourceObject" 39 <source id="videoSourceObject"
40 type="video/mp4" 40 type="video/ogg"
41 onerror="media_error_handler(source_test)"> 41 onerror="media_error_handler(source_test)">
42 </video> 42 </video>
43 <video id="videoObject2" width="320" height="240" controls 43 <video id="videoObject2" width="320" height="240" controls
44 onerror="media_error_handler(src_test)" 44 onerror="media_error_handler(src_test)"
45 onloadeddata="media_loaded(src_test)"> 45 onloadeddata="media_loaded(src_test)">
46 46
47 <script> 47 <script>
48 document.getElementById("videoSourceObject").src = mediaURL; 48 document.getElementById("videoSourceObject").src = mediaURL;
49 document.getElementById("videoObject2").src = mediaURL; 49 document.getElementById("videoObject2").src = mediaURL;
50 </script> 50 </script>
51 51
52 <script async defer src='../support/checkReport.sub.js?reportField=violated- directive&reportValue=media-src%20%27self%27'></script> 52 <script async defer src='../support/checkReport.sub.js?reportField=violated- directive&reportValue=media-src%20%27self%27'></script>
53 53
54 </body> 54 </body>
55 </html> 55 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698