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

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

Issue 2704543002: Import wpt@3bd204d7e86fd81e98e63f4ce59b95d98bad1c54 (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/media-src/media-src-redir-bug.sub.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/media-src/media-src-redir-bug.sub.html b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/media-src/media-src-redir-bug.sub.html
new file mode 100644
index 0000000000000000000000000000000000000000..b83511930416abde6d35f7d7ec6348a315d62d91
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/media-src/media-src-redir-bug.sub.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Video element src attribute must match src list - positive test</title>
+ <script src='/resources/testharness.js'></script>
+ <script src='/resources/testharnessreport.js'></script>
+</head>
+<body>
+ <h1>Video element in media-src list - redirect test</h1>
+ <div id='log'></div>
+
+ <p>This test tests a buggy interaction in Chrome 46. Two hosts (self and www2) are both allowed
+ as media-src, but only one (self) is allowed for connect-src. If a video src starts on
+ an allowed host (self), and is redirected to another allowed media-src host, it should succeed. But a bug
+ causes the redirect to be done in a fetch context to which connect-src is being applied instead, so
+ the load is blocked. (This test passes in Firefox 45, modulo an event listener not firing.)</p>
+
+ <script>
+ var src_test = async_test("In-policy async video src");
+ var src_redir_test = async_test("in-policy async video src w/redir")
+ var source_test = async_test("In-policy async video source element");
+ var source_redir_test = async_test("In-policy async video source element w/redir");
+
+ function media_loaded(t) {
+ t.done();
+ }
+
+ function media_error_handler(t) {
+ t.step( function () {
+ assert_unreached("Media error handler shouldn't be triggered for allowed domain.");
+ });
+ t.done();
+ }
+ </script>
+
+ <video id="videoObject" width="320" height="240" controls
+ onloadeddata="media_loaded(source_test)">
+ <source id="videoSourceObject"
+ type="video/mp4"
+ onerror="media_error_handler(source_test)"
+ src="http://www2.{{host}}:{{ports[http][0]}}/media/white.mp4">
+ </video>
+
+ <video id="videoObject2" width="320" height="240" controls
+ onerror="media_error_handler(src_test)"
+ onloadeddata="media_loaded(src_test)"
+ src="http://www2.{{host}}:{{ports[http][0]}}/media/white.mp4">
+
+ <video id="videoObject3" width="320" height="240" controls
+ onloadeddata="media_loaded(source_redir_test)">
+ <source id="videoSourceObject"
+ type="video/mp4"
+ onerror="media_error_handler(source_test)"
+ src="/common/redirect.py?location=http://www2.{{host}}:{{ports[http][0]}}/media/white.mp4">
+ </video>
+
+ <video id="videoObject2" width="320" height="240" controls
+ onerror="media_error_handler(src_redir_test)"
+ onloadeddata="media_loaded(src_redir_test)"
+ src="/common/redirect.py?location=http://www2.{{host}}:{{ports[http][0]}}/media/white.mp4">
+
+ <script async defer src="../support/checkReport.sub.js?reportExists=false">
+ </script>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698