Diff
Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (197084 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog 2016-02-25 10:26:22 UTC (rev 197084)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog 2016-02-25 10:26:42 UTC (rev 197085)
@@ -1,5 +1,36 @@
2016-02-21 Daniel Bates <daba...@apple.com>
+ Another attempt to fix the Content Extension test failures following <https://trac.webkit.org/changeset/196875>
+ (https://bugs.webkit.org/show_bug.cgi?id=154307)
+
+ Rename Content Extension JSON files so that they are associated with tests http/tests/contentextensions/block-cookies-in-csp-report.php
+ http/tests/contentextensions/block-csp-report.php and http/tests/contentextensions/hide-on-csp-report.php. These
+ files were formerly named block-cookies-in-csp-report.html, block-csp-report.html, and hide-on-csp-report.html,
+ respectively, prior to <https://trac.webkit.org/changeset/196878>. Also, update expected result for test block-csp-report.html
+ following <https://trac.webkit.org/changeset/196878>.
+
+ * http/tests/contentextensions/block-cookies-in-csp-report.php.json: Renamed from LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.html.json.
+ * http/tests/contentextensions/block-csp-report-expected.txt:
+ * http/tests/contentextensions/block-csp-report.php.json: Renamed from LayoutTests/http/tests/contentextensions/block-csp-report.html.json.
+ * http/tests/contentextensions/hide-on-csp-report.php.json: Renamed from LayoutTests/http/tests/contentextensions/hide-on-csp-report.html.json.
+
+2016-02-21 Daniel Bates <daba...@apple.com>
+
+ Attempt to fix the Content Extension test failures following <https://trac.webkit.org/changeset/196875>
+ (https://bugs.webkit.org/show_bug.cgi?id=154307)
+
+ Convert Content Extension tests that use the Content Security Policy directive report-uri from HTML files
+ to PHP scripts and modified them to define the content security policy for the page via the Content-Security-Policy
+ HTTP header instead of via a meta element so that the report-uri directive is honored. Following
+ <https://trac.webkit.org/changeset/196875> the directive report-uri is only honored when contained in a
+ policy that is delivered via an HTTP header. That is, it is no longer honored when delivered in a meta element.
+
+ * http/tests/contentextensions/block-cookies-in-csp-report.php: Renamed from LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.html.
+ * http/tests/contentextensions/block-csp-report.php: Renamed from LayoutTests/http/tests/contentextensions/block-csp-report.html.
+ * http/tests/contentextensions/hide-on-csp-report.php: Renamed from LayoutTests/http/tests/contentextensions/hide-on-csp-report.html.
+
+2016-02-21 Daniel Bates <daba...@apple.com>
+
CSP: Violation report should include column number
https://bugs.webkit.org/show_bug.cgi?id=154418
<rdar://problem/24729525>
Deleted: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.html (197084 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.html 2016-02-25 10:26:22 UTC (rev 197084)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.html 2016-02-25 10:26:42 UTC (rev 197085)
@@ -1,40 +0,0 @@
-<head>
-<meta http-equiv="Content-Security-Policy" content="img-src 'self'; report-uri /contentextensions/resources/save-ping.php?test=contentextensions-block-cookies-in-csp-report">
-<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.dumpChildFramesAsText();
- testRunner.waitUntilDone();
-}
-
-function deletePing() {
- var deletePingContainer = document.getElementById("delete_ping_container");
- deletePingContainer.innerHTML = '<img src="" _onerror_="loadCrossDomainImage();">';
-}
-
-function loadCrossDomainImage() {
- // Trying to load an image from a different port
- // will result in a CSP violation.
- var img = new Image(1, 1);
- img.src = ""
- showPingResult();
-}
-
-function showPingResult() {
- var iframe = document.getElementById("result_frame");
- iframe._onload_ = function() {
- if (window.testRunner) { testRunner.notifyDone(); }
- }
- iframe.src = ""
-}
-</script>
-</head>
-
-<body>
-This test creates a CSP violation report, but the report URL matches a 'block-cookie' rule.
-<img src=""
- _onerror_="deletePing();">
-<div id="delete_ping_container"></div>
-<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
-</body>
-
Deleted: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.html.json (197084 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.html.json 2016-02-25 10:26:22 UTC (rev 197084)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.html.json 2016-02-25 10:26:42 UTC (rev 197085)
@@ -1,10 +0,0 @@
-[
- {
- "trigger": {
- "url-filter": "save-ping.php"
- },
- "action": {
- "type": "block-cookies"
- }
- }
-]
Copied: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php (from rev 197084, releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.html) (0 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php 2016-02-25 10:26:42 UTC (rev 197085)
@@ -0,0 +1,42 @@
+<?php
+ header("Content-Security-Policy: img-src 'self'; report-uri /contentextensions/resources/save-ping.php?test=contentextensions-block-cookies-in-csp-report");
+?>
+<head>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+ testRunner.waitUntilDone();
+}
+
+function deletePing() {
+ var deletePingContainer = document.getElementById("delete_ping_container");
+ deletePingContainer.innerHTML = '<img src="" _onerror_="loadCrossDomainImage();">';
+}
+
+function loadCrossDomainImage() {
+ // Trying to load an image from a different port
+ // will result in a CSP violation.
+ var img = new Image(1, 1);
+ img.src = ""
+ showPingResult();
+}
+
+function showPingResult() {
+ var iframe = document.getElementById("result_frame");
+ iframe._onload_ = function() {
+ if (window.testRunner) { testRunner.notifyDone(); }
+ }
+ iframe.src = ""
+}
+</script>
+</head>
+
+<body>
+This test creates a CSP violation report, but the report URL matches a 'block-cookie' rule.
+<img src=""
+ _onerror_="deletePing();">
+<div id="delete_ping_container"></div>
+<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
+</body>
+
Copied: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php.json (from rev 197084, releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.html.json) (0 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php.json (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.php.json 2016-02-25 10:26:42 UTC (rev 197085)
@@ -0,0 +1,10 @@
+[
+ {
+ "trigger": {
+ "url-filter": "save-ping.php"
+ },
+ "action": {
+ "type": "block-cookies"
+ }
+ }
+]
Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report-expected.txt (197084 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report-expected.txt 2016-02-25 10:26:22 UTC (rev 197084)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report-expected.txt 2016-02-25 10:26:42 UTC (rev 197085)
@@ -1,6 +1,6 @@
CONSOLE MESSAGE: Refused to load the image 'http://localhost/foo.png' because it violates the following Content Security Policy directive: "img-src 'self'".
-CONSOLE MESSAGE: line 34: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-csp-report.html from loading a resource from http://localhost:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-csp-report
+CONSOLE MESSAGE: line 33: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-csp-report.php from loading a resource from http://localhost:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-csp-report
This test creates a CSP violation report, but the report URL matches a 'block' rule.
--------
Deleted: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.html (197084 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.html 2016-02-25 10:26:22 UTC (rev 197084)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.html 2016-02-25 10:26:42 UTC (rev 197085)
@@ -1,37 +0,0 @@
-<head>
-<meta http-equiv="Content-Security-Policy" content="img-src 'self'; report-uri http://localhost:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-csp-report">
-<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.dumpChildFramesAsText();
- testRunner.waitUntilDone();
-}
-
-function loadCrossDomainImage() {
- // Trying to load an image from a different port
- // will result in a CSP violation.
- var img = new Image(1, 1);
- img.src = ""
- showPingResult();
-}
-
-function showPingResult() {
- var iframe = document.getElementById("result_frame");
- iframe._onload_ = function() {
- if (window.testRunner) { testRunner.notifyDone(); }
- }
- iframe.src = ""
- // Why timeout_ms=1000:
- // To pass the test, the ping shouldn't arrive, so we need to
- // timeout at some point. We don't have to wait too long because
- // the console message can tell us whether the ping was blocked.
-}
-</script>
-</head>
-
-<body>
-This test creates a CSP violation report, but the report URL matches a 'block' rule.
-<img src="" _onerror_="loadCrossDomainImage();">
-<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
-</body>
-
Deleted: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.html.json (197084 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.html.json 2016-02-25 10:26:22 UTC (rev 197084)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.html.json 2016-02-25 10:26:42 UTC (rev 197085)
@@ -1,10 +0,0 @@
-[
- {
- "trigger": {
- "url-filter": "save-ping.php"
- },
- "action": {
- "type": "block"
- }
- }
-]
Copied: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.php (from rev 197084, releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.html) (0 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.php (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.php 2016-02-25 10:26:42 UTC (rev 197085)
@@ -0,0 +1,39 @@
+<?php
+ header("Content-Security-Policy: img-src 'self'; report-uri http://localhost:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-csp-report");
+?>
+<head>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+ testRunner.waitUntilDone();
+}
+
+function loadCrossDomainImage() {
+ // Trying to load an image from a different port
+ // will result in a CSP violation.
+ var img = new Image(1, 1);
+ img.src = ""
+ showPingResult();
+}
+
+function showPingResult() {
+ var iframe = document.getElementById("result_frame");
+ iframe._onload_ = function() {
+ if (window.testRunner) { testRunner.notifyDone(); }
+ }
+ iframe.src = ""
+ // Why timeout_ms=1000:
+ // To pass the test, the ping shouldn't arrive, so we need to
+ // timeout at some point. We don't have to wait too long because
+ // the console message can tell us whether the ping was blocked.
+}
+</script>
+</head>
+
+<body>
+This test creates a CSP violation report, but the report URL matches a 'block' rule.
+<img src="" _onerror_="loadCrossDomainImage();">
+<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
+</body>
+
Copied: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.php.json (from rev 197084, releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.html.json) (0 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.php.json (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/block-csp-report.php.json 2016-02-25 10:26:42 UTC (rev 197085)
@@ -0,0 +1,10 @@
+[
+ {
+ "trigger": {
+ "url-filter": "save-ping.php"
+ },
+ "action": {
+ "type": "block"
+ }
+ }
+]
Deleted: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.html (197084 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.html 2016-02-25 10:26:22 UTC (rev 197084)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.html 2016-02-25 10:26:42 UTC (rev 197085)
@@ -1,35 +0,0 @@
-<head>
-<meta http-equiv="Content-Security-Policy" content="img-src 'self'; report-uri http://localhost:8000/contentextensions/resources/save-ping.php?test=contentextensions-hide-on-csp-report">
-<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.dumpChildFramesAsText();
- testRunner.waitUntilDone();
-}
-
-function loadCrossDomainImage() {
- // Trying to load an image from a different port
- // will result in a CSP violation.
- var img = new Image(1, 1);
- img.src = ""
- showPingResult();
-}
-
-function showPingResult() {
- var iframe = document.getElementById("result_frame");
- iframe._onload_ = function() {
- if (window.testRunner) { testRunner.notifyDone(); }
- }
- iframe.src = ""
-}
-</script>
-</head>
-
-<body>
-This test creates a CSP violation report, but the report URL matches a 'css-display-none' rule.
-<p class="foo">This text should be hidden once the report is sent.</p>
-<p class="bar">This text should remain visible.</p>
-<img src="" _onerror_="loadCrossDomainImage();">
-<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
-</body>
-
Deleted: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.html.json (197084 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.html.json 2016-02-25 10:26:22 UTC (rev 197084)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.html.json 2016-02-25 10:26:42 UTC (rev 197085)
@@ -1,11 +0,0 @@
-[
- {
- "trigger": {
- "url-filter": "save-ping.php"
- },
- "action": {
- "type": "css-display-none",
- "selector": ".foo"
- }
- }
-]
Copied: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php (from rev 197084, releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.html) (0 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php 2016-02-25 10:26:42 UTC (rev 197085)
@@ -0,0 +1,37 @@
+<?php
+ header("Content-Security-Policy: img-src 'self'; report-uri http://localhost:8000/contentextensions/resources/save-ping.php?test=contentextensions-hide-on-csp-report");
+?>
+<head>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+ testRunner.waitUntilDone();
+}
+
+function loadCrossDomainImage() {
+ // Trying to load an image from a different port
+ // will result in a CSP violation.
+ var img = new Image(1, 1);
+ img.src = ""
+ showPingResult();
+}
+
+function showPingResult() {
+ var iframe = document.getElementById("result_frame");
+ iframe._onload_ = function() {
+ if (window.testRunner) { testRunner.notifyDone(); }
+ }
+ iframe.src = ""
+}
+</script>
+</head>
+
+<body>
+This test creates a CSP violation report, but the report URL matches a 'css-display-none' rule.
+<p class="foo">This text should be hidden once the report is sent.</p>
+<p class="bar">This text should remain visible.</p>
+<img src="" _onerror_="loadCrossDomainImage();">
+<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe>
+</body>
+
Copied: releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php.json (from rev 197084, releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.html.json) (0 => 197085)
--- releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php.json (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/http/tests/contentextensions/hide-on-csp-report.php.json 2016-02-25 10:26:42 UTC (rev 197085)
@@ -0,0 +1,11 @@
+[
+ {
+ "trigger": {
+ "url-filter": "save-ping.php"
+ },
+ "action": {
+ "type": "css-display-none",
+ "selector": ".foo"
+ }
+ }
+]