Title: [200155] trunk/LayoutTests
Revision
200155
Author
[email protected]
Date
2016-04-27 15:50:02 -0700 (Wed, 27 Apr 2016)

Log Message

CSP: Add tests for setting allowContentSecurityPolicySourceStarToMatchAnyProtocol
https://bugs.webkit.org/show_bug.cgi?id=157100

Reviewed by Brent Fulgham.

Add tests to ensure that we do not regress the behavior of setting allowContentSecurityPolicySourceStarToMatchAnyProtocol.
For completeness, this setting was added in r200130 (https://bugs.webkit.org/show_bug.cgi?id=157005) to enable or disable
whether source * can match any protocol as part of a workaround for the iOS apps Ecobee and Quora.

* fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
* fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
* fast/dom/HTMLImageElement/image-with-file-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
* fast/dom/HTMLImageElement/image-with-file-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
* fast/dom/HTMLLinkElement/link-with-blob-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
* fast/dom/HTMLLinkElement/link-with-blob-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
* fast/dom/HTMLLinkElement/link-with-data-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
* fast/dom/HTMLLinkElement/link-with-data-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
* fast/dom/HTMLLinkElement/link-with-file-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
* fast/dom/HTMLLinkElement/link-with-file-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
* fast/dom/HTMLLinkElement/resources/green-background-color.css: Added.
(#test):
* media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Copied from LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star.html.
* media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Copied from LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star.html.
* media/video-with-file-url-blocked-by-csp-media-src-star-expected.html: Substitute "blocked" for "allowed" since the purpose of the corresponding
test is to ensure that we block loading a file URL video.
* media/video-with-file-url-blocked-by-csp-media-src-star.html: Substitute "blocked" for "allowed" since the purpose of this test is to ensure
that we block loading a file URL video. Additionally, register an oncanplaythrough handler instead of an onloadedmetadata handler and call testFinished()
to signal test completion on a zero timer as a means to help ensure that the first frame of the video is drawn should we regress the blocking of a video file URL.
* platform/wk2/TestExpectations: Skip test LayoutTests/fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html
when using WebKitTestRunner because WebKitTestRunner does not support eventSender.beginDragWithFiles(). See need to fix
<https://bugs.webkit.org/show_bug.cgi?id=64285>.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (200154 => 200155)


--- trunk/LayoutTests/ChangeLog	2016-04-27 22:48:23 UTC (rev 200154)
+++ trunk/LayoutTests/ChangeLog	2016-04-27 22:50:02 UTC (rev 200155)
@@ -1,3 +1,37 @@
+2016-04-27  Daniel Bates  <[email protected]>
+
+        CSP: Add tests for setting allowContentSecurityPolicySourceStarToMatchAnyProtocol
+        https://bugs.webkit.org/show_bug.cgi?id=157100
+
+        Reviewed by Brent Fulgham.
+
+        Add tests to ensure that we do not regress the behavior of setting allowContentSecurityPolicySourceStarToMatchAnyProtocol.
+        For completeness, this setting was added in r200130 (https://bugs.webkit.org/show_bug.cgi?id=157005) to enable or disable
+        whether source * can match any protocol as part of a workaround for the iOS apps Ecobee and Quora.
+
+        * fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
+        * fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
+        * fast/dom/HTMLImageElement/image-with-file-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
+        * fast/dom/HTMLImageElement/image-with-file-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
+        * fast/dom/HTMLLinkElement/link-with-blob-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
+        * fast/dom/HTMLLinkElement/link-with-blob-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
+        * fast/dom/HTMLLinkElement/link-with-data-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
+        * fast/dom/HTMLLinkElement/link-with-data-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
+        * fast/dom/HTMLLinkElement/link-with-file-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
+        * fast/dom/HTMLLinkElement/link-with-file-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
+        * fast/dom/HTMLLinkElement/resources/green-background-color.css: Added.
+        (#test):
+        * media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Copied from LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star.html.
+        * media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Copied from LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star.html.
+        * media/video-with-file-url-blocked-by-csp-media-src-star-expected.html: Substitute "blocked" for "allowed" since the purpose of the corresponding
+        test is to ensure that we block loading a file URL video.
+        * media/video-with-file-url-blocked-by-csp-media-src-star.html: Substitute "blocked" for "allowed" since the purpose of this test is to ensure
+        that we block loading a file URL video. Additionally, register an oncanplaythrough handler instead of an onloadedmetadata handler and call testFinished()
+        to signal test completion on a zero timer as a means to help ensure that the first frame of the video is drawn should we regress the blocking of a video file URL.
+        * platform/wk2/TestExpectations: Skip test LayoutTests/fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html
+        when using WebKitTestRunner because WebKitTestRunner does not support eventSender.beginDragWithFiles(). See need to fix
+        <https://bugs.webkit.org/show_bug.cgi?id=64285>.
+
 2016-04-27  Ryan Haddad  <[email protected]>
 
         Marking compositing/contents-scale/incremental-change.html as a flaky failure on ios-simulator-wk2

Added: trunk/LayoutTests/fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html (0 => 200155)


--- trunk/LayoutTests/fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that loading image with a blob URL is allowed when the page has Content Security Policy &quot;image-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. To run this test by hand, select an image file. This test PASSED if the image loads. Otherwise, it FAILED.</p>
+<img width="128" height="128" src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html (0 => 200155)


--- trunk/LayoutTests/fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Security-Policy" content="img-src *">
+</head>
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+if (window.internals && window.internals.settings)
+    internals.settings.setAllowContentSecurityPolicySourceStarToMatchAnyProtocol(true);
+
+var fileInput;
+
+function testFinished()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+function loadImage(event)
+{
+    var image = document.createElement("img");
+    image.height = "128";
+    image.width = "128";
+    image.alt = "FAIL";
+    image._onload_ = testFinished;
+    image._onerror_ = testFinished;
+    image.src = ""
+
+    document.body.removeChild(fileInput);
+    document.body.appendChild(image);
+}
+
+function runTest()
+{
+    if (!window.eventSender)
+        return;
+
+    var x = fileInput.offsetLeft + fileInput.offsetWidth / 2;
+    var y = fileInput.offsetTop + fileInput.offsetHeight / 2;
+
+    eventSender.beginDragWithFiles(["../resources/abe.png"]);
+    eventSender.mouseMoveTo(x, y);
+    eventSender.mouseUp();
+}
+
+window._onload_ = function ()
+{
+    fileInput = document.getElementById("file");
+    fileInput._onchange_ = loadImage;
+    runTest();
+}
+</script>
+<body>
+<p>This tests that loading image with a blob URL is allowed when the page has Content Security Policy &quot;image-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. To run this test by hand, select an image file. This test PASSED if the image loads. Otherwise, it FAILED.</p>
+<input type="file" id="file" accept="image/*">
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/HTMLImageElement/image-with-file-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html (0 => 200155)


--- trunk/LayoutTests/fast/dom/HTMLImageElement/image-with-file-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLImageElement/image-with-file-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that loading image with a file URL is allowed when the page has Content Security Policy &quot;image-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. This test PASSED if you see a green square below. Otherwise, it FAILED.</p>
+<img src="" width="128" height="128">
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/HTMLImageElement/image-with-file-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html (0 => 200155)


--- trunk/LayoutTests/fast/dom/HTMLImageElement/image-with-file-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLImageElement/image-with-file-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Security-Policy" content="img-src *">
+<script>
+if (window.internals && window.internals.settings)
+    internals.settings.setAllowContentSecurityPolicySourceStarToMatchAnyProtocol(true);
+</script>
+</head>
+<body>
+<p>This tests that loading image with a file URL is allowed when the page has Content Security Policy &quot;image-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. This test PASSED if you see a green square below. Otherwise, it FAILED.</p>
+<img src="" width="128" height="128" alt="FAIL">
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-blob-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html (0 => 200155)


--- trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-blob-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-blob-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that loading a stylesheet with a blob URL is allowed when the page has Content Security Policy &quot;style-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. This test PASSED if you see a green square below. Otherwise, it FAILED.</p>
+<div style="background-color: green; height: 128px; width: 128px"></div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-blob-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html (0 => 200155)


--- trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-blob-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-blob-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#test {
+    background-color: red;
+    height: 128px;
+    width: 128px;
+}
+</style>
+<meta http-equiv="Content-Security-Policy" content="style-src *">
+<script>
+if (window.internals && window.internals.settings)
+    internals.settings.setAllowContentSecurityPolicySourceStarToMatchAnyProtocol(true);
+
+function createLinkElementWithStylesheet(stylesheetURL)
+{
+    var link = document.createElement("link");
+    link.rel = "stylesheet";
+    link.href = ""
+    return link;
+}
+
+var blobURL = window.URL.createObjectURL(new Blob(["#test { background-color: green !important; }"], {type: "text/css"}));
+document.head.appendChild(createLinkElementWithStylesheet(blobURL));
+</script>
+</head>
+<body>
+<p>This tests that loading a stylesheet with a blob URL is allowed when the page has Content Security Policy &quot;style-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. This test PASSED if you see a green square below. Otherwise, it FAILED.</p>
+<div id="test"></div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-data-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html (0 => 200155)


--- trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-data-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-data-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that loading a stylesheet with a data URL is allowed when the page has Content Security Policy &quot;style-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. This test PASSED if you see a green square below. Otherwise, it FAILED.</p>
+<div style="background-color: green; height: 128px; width: 128px"></div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-data-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html (0 => 200155)


--- trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-data-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-data-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#test {
+    background-color: red;
+    height: 128px;
+    width: 128px;
+}
+</style>
+<meta http-equiv="Content-Security-Policy" content="style-src *">
+<script>
+if (window.internals && window.internals.settings)
+    internals.settings.setAllowContentSecurityPolicySourceStarToMatchAnyProtocol(true);
+</script>
+<link rel="stylesheet" href="" #test { background-color: green !important; }">
+</head>
+<body>
+<p>This tests that loading a stylesheet with a data URL is allowed when the page has Content Security Policy &quot;style-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. This test PASSED if you see a green square below. Otherwise, it FAILED.</p>
+<div id="test"></div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-file-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html (0 => 200155)


--- trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-file-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-file-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that loading a stylesheet with a file URL is allowed when the page has Content Security Policy &quot;style-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. This test PASSED if you see a green square below. Otherwise, it FAILED.</p>
+<div style="background-color: green; height: 128px; width: 128px"></div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-file-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html (0 => 200155)


--- trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-file-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLLinkElement/link-with-file-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#test {
+    background-color: red;
+    height: 128px;
+    width: 128px;
+}
+</style>
+<meta http-equiv="Content-Security-Policy" content="style-src *">
+<script>
+if (window.internals && window.internals.settings)
+    internals.settings.setAllowContentSecurityPolicySourceStarToMatchAnyProtocol(true);
+</script>
+<link rel="stylesheet" href=""
+</head>
+<body>
+<p>This tests that loading a stylesheet with a file URL is allowed when the page has Content Security Policy &quot;style-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. This test PASSED if you see a green square below. Otherwise, it FAILED.</p>
+<div id="test"></div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/HTMLLinkElement/resources/green-background-color.css (0 => 200155)


--- trunk/LayoutTests/fast/dom/HTMLLinkElement/resources/green-background-color.css	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLLinkElement/resources/green-background-color.css	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1 @@
+#test { background-color: green !important; }

Copied: trunk/LayoutTests/media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html (from rev 200154, trunk/LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star.html) (0 => 200155)


--- trunk/LayoutTests/media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html	                        (rev 0)
+++ trunk/LayoutTests/media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+function testFinished()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window._onload_ = function ()
+{
+    var video = document.getElementById("video");
+    video._oncanplaythrough_ = function () {
+        // Use a zero timer to ensure that the first frame of the video is drawn.
+        window.setTimeout(testFinished, 0);
+    }
+    video._onerror_ = testFinished;
+    video.src = "" "content/test");
+}
+</script>
+</head>
+<body>
+<p>This tests that loading a video with a file URL is allowed when the page has Content Security Policy &quot;media-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. This test PASSED if the video loads. Otherwise, it FAILED.</p>
+<video id="video"></video>
+</body>
+</html>

Copied: trunk/LayoutTests/media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html (from rev 200154, trunk/LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star.html) (0 => 200155)


--- trunk/LayoutTests/media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html	                        (rev 0)
+++ trunk/LayoutTests/media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Security-Policy" content="media-src *">
+<script src=""
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+if (window.internals && window.internals.settings)
+    internals.settings.setAllowContentSecurityPolicySourceStarToMatchAnyProtocol(true);
+
+function testFinished()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window._onload_ = function ()
+{
+    var video = document.getElementById("video");
+    video._oncanplaythrough_ = function () {
+        // Use a zero timer to ensure that the first frame of the video is drawn.
+        window.setTimeout(testFinished, 0);
+    }
+    video._onerror_ = testFinished;
+    video.src = "" "content/test");
+}
+</script>
+</head>
+<body>
+<p>This tests that loading a video with a file URL is allowed when the page has Content Security Policy &quot;media-src *&quot; and the WebKit setting AllowContentSecurityPolicySourceStarToMatchAnyProtocol is enabled. This test PASSED if the video loads. Otherwise, it FAILED.</p>
+<video id="video"></video>
+</body>
+</html>

Modified: trunk/LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star-expected.html (200154 => 200155)


--- trunk/LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star-expected.html	2016-04-27 22:48:23 UTC (rev 200154)
+++ trunk/LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star-expected.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -10,7 +10,7 @@
 </style>
 </head>
 <body>
-<p>This tests that loading a video with a file URL is allowed when the page has Content Security Policy &quot;media-src *&quot;. This test PASSED if you see a solid green square. Otherwise, it FAILED.</p>
+<p>This tests that loading a video with a file URL is blocked when the page has Content Security Policy &quot;media-src *&quot;. This test PASSED if you see a solid green square. Otherwise, it FAILED.</p>
 <div id="equivalent-expected-result"></div>
 </body>
 </html>

Modified: trunk/LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star.html (200154 => 200155)


--- trunk/LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star.html	2016-04-27 22:48:23 UTC (rev 200154)
+++ trunk/LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star.html	2016-04-27 22:50:02 UTC (rev 200155)
@@ -23,14 +23,17 @@
 window._onload_ = function ()
 {
     var video = document.getElementById("video");
-    video._onloadedmetadata_ = testFinished;
+    video._oncanplaythrough_ = function () {
+        // Use a zero timer to ensure that the first frame of the video is drawn.
+        window.setTimeout(testFinished, 0);
+    }
     video._onerror_ = testFinished;
     video.src = "" "content/test");
 }
 </script>
 </head>
 <body>
-<p>This tests that loading a video with a file URL is allowed when the page has Content Security Policy &quot;media-src *&quot;. This test PASSED if you see a solid green square. Otherwise, it FAILED.</p>
+<p>This tests that loading a video with a file URL is blocked when the page has Content Security Policy &quot;media-src *&quot;. This test PASSED if you see a solid green square. Otherwise, it FAILED.</p>
 <video id="video"></video>
 </body>
 </html>

Modified: trunk/LayoutTests/platform/wk2/TestExpectations (200154 => 200155)


--- trunk/LayoutTests/platform/wk2/TestExpectations	2016-04-27 22:48:23 UTC (rev 200154)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2016-04-27 22:50:02 UTC (rev 200155)
@@ -619,6 +619,7 @@
 editing/pasteboard/file-drag-to-editable.html
 editing/pasteboard/file-input-files-access.html
 fast/dom/HTMLImageElement/image-with-blob-url-blocked-by-csp-img-src-star.html
+fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html
 fast/dom/Window/window-postmessage-clone-frames.html
 fast/dom/Window/window-postmessage-clone.html
 fast/events/data-transfer-files-attribute-identity.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to