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

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

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests Created 3 years, 10 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
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Video element src attribute must match src list - positive test</titl e>
5 <script src='/resources/testharness.js'></script>
6 <script src='/resources/testharnessreport.js'></script>
7 </head>
8 <body>
9 <h1>Video element in media-src list - redirect test</h1>
10 <div id='log'></div>
11
12 <p>This test tests a buggy interaction in Chrome 46. Two hosts (self and www2 ) are both allowed
13 as media-src, but only one (self) is allowed for connect-src. If a video sr c starts on
14 an allowed host (self), and is redirected to another allowed media-src host, it should succeed. But a bug
15 causes the redirect to be done in a fetch context to which connect-src is be ing applied instead, so
16 the load is blocked. (This test passes in Firefox 45, modulo an event listen er not firing.)</p>
17
18 <script>
19 var src_test = async_test("In-policy async video src");
20 var src_redir_test = async_test("in-policy async video src w/redir")
21 var source_test = async_test("In-policy async video source element");
22 var source_redir_test = async_test("In-policy async video source element w/r edir");
23
24 function media_loaded(t) {
25 t.done();
26 }
27
28 function media_error_handler(t) {
29 t.step( function () {
30 assert_unreached("Media error handler shouldn't be triggered for allow ed domain.");
31 });
32 t.done();
33 }
34 </script>
35
36 <video id="videoObject" width="320" height="240" controls
37 onloadeddata="media_loaded(source_test)">
38 <source id="videoSourceObject"
39 type="video/mp4"
40 onerror="media_error_handler(source_test)"
41 src="http://www2.{{host}}:{{ports[http][0]}}/media/white.mp4">
42 </video>
43
44 <video id="videoObject2" width="320" height="240" controls
45 onerror="media_error_handler(src_test)"
46 onloadeddata="media_loaded(src_test)"
47 src="http://www2.{{host}}:{{ports[http][0]}}/media/white.mp4">
48
49 <video id="videoObject3" width="320" height="240" controls
50 onloadeddata="media_loaded(source_redir_test)">
51 <source id="videoSourceObject"
52 type="video/mp4"
53 onerror="media_error_handler(source_test)"
54 src="/common/redirect.py?location=http://www2.{{host}}:{{ports[h ttp][0]}}/media/white.mp4">
55 </video>
56
57 <video id="videoObject2" width="320" height="240" controls
58 onerror="media_error_handler(src_redir_test)"
59 onloadeddata="media_loaded(src_redir_test)"
60 src="/common/redirect.py?location=http://www2.{{host}}:{{ports[http][ 0]}}/media/white.mp4">
61
62 <script async defer src="../support/checkReport.sub.js?reportExists=false">
63 </script>
64
65 </body>
66 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698