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

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

Issue 2766913003: Fixed and improved content-security-policy/media-src tests (Closed)
Patch Set: Re-edited TestExpectations after a rebase-update to try to make the patch apply properly this time 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 + "//{{domains[www2]}}:{{ports[http][0]}} /media/A4.ogv";
19 "//www2." +
20 location.hostname +
21 ":" +
22 location.port +
23 "/media/white.mp4";
24 19
25 function media_loaded(t) { 20 function media_loaded(t) {
26 t.step( function () { 21 t.step( function () {
27 assert_unreached("Media error handler should be triggered for non-allo wed domain."); 22 assert_unreached("Media error handler should be triggered for non-allo wed domain.");
28 }); 23 });
29 t.done(); 24 t.done();
30 } 25 }
31 26
32 function media_error_handler(t) { 27 function media_error_handler(t) {
33 t.done(); 28 t.done();
34 } 29 }
35 </script> 30 </script>
36 31
37 <video id="videoObject" width="320" height="240" controls 32 <video id="videoObject" width="320" height="240" controls
38 onloadeddata="media_loaded(source_test)"> 33 onloadeddata="media_loaded(source_test)">
39 <source id="videoSourceObject" 34 <source id="videoSourceObject"
40 type="video/mp4" 35 type="video/ogg"
41 onerror="media_error_handler(source_test)"> 36 onerror="media_error_handler(source_test)">
42 </video> 37 </video>
43 <video id="videoObject2" width="320" height="240" controls 38 <video id="videoObject2" width="320" height="240" controls
44 onerror="media_error_handler(src_test)" 39 onerror="media_error_handler(src_test)"
45 onloadeddata="media_loaded(src_test)"> 40 onloadeddata="media_loaded(src_test)">
46 41
47 <script> 42 <script>
48 document.getElementById("videoSourceObject").src = mediaURL; 43 document.getElementById("videoSourceObject").src = mediaURL;
49 document.getElementById("videoObject2").src = mediaURL; 44 document.getElementById("videoObject2").src = mediaURL;
50 </script> 45 </script>
51 46
52 <script async defer src='../support/checkReport.sub.js?reportField=violated- directive&reportValue=media-src%20%27self%27'></script> 47 <script async defer src='../support/checkReport.sub.js?reportField=violated- directive&reportValue=media-src%20%27self%27'></script>
53 48
54 </body> 49 </body>
55 </html> 50 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698