| Index: LayoutTests/http/tests/security/contentSecurityPolicy/resources/worker.php
|
| diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/resources/worker.php b/LayoutTests/http/tests/security/contentSecurityPolicy/resources/worker.php
|
| index a090d783b36d3b03a6d9af8b509f248fbf76af07..06e5d20bb0b1d9a0f29ccbfd20d02ea5bbe8b25e 100644
|
| --- a/LayoutTests/http/tests/security/contentSecurityPolicy/resources/worker.php
|
| +++ b/LayoutTests/http/tests/security/contentSecurityPolicy/resources/worker.php
|
| @@ -34,7 +34,7 @@ var fn = function() {
|
| postMessage('Function() function blocked');
|
| }
|
| try {
|
| - fn = new Function("", "postMessage('Function() function allowed');");
|
| + fn = new Function("", "postMessage('Function() function allowed');");
|
| }
|
| catch(e) {
|
| }
|
| @@ -57,13 +57,31 @@ try {
|
|
|
| try {
|
| var xhr = new XMLHttpRequest;
|
| - xhr.open("GET", "http://127.0.0.1:8000/xmlhttprequest/resources/get.txt", true);
|
| + xhr.open("GET", "http://127.0.0.1:8000/xmlhttprequest/resources/get.txt", true);
|
| postMessage("xhr allowed");
|
| } catch(e) {
|
| postMessage("xhr blocked");
|
| }
|
|
|
| <?php
|
| +} else if ($_GET["type"] == "shared-make-xhr") {
|
| +?>
|
| +
|
| +onconnect = function (e) {
|
| + var port = e.ports[0];
|
| + try {
|
| + var xhr = new XMLHttpRequest;
|
| + xhr.open(
|
| + "GET",
|
| + "http://127.0.0.1:8000/xmlhttprequest/resources/get.txt",
|
| + true);
|
| + port.postMessage("xhr allowed");
|
| + } catch(e) {
|
| + port.postMessage("xhr blocked");
|
| + }
|
| +}
|
| +
|
| +<?php
|
| } else if ($_GET["type"] == "set-timeout") {
|
| ?>
|
|
|
| @@ -92,5 +110,22 @@ xhr.onload = function () {
|
| xhr.send();
|
|
|
| <?php
|
| +} else if ($_GET["type"] == "shared-report-referrer") {
|
| +?>
|
| +
|
| +onconnect = function (e) {
|
| + var port = e.ports[0];
|
| + var xhr = new XMLHttpRequest;
|
| + xhr.open(
|
| + "GET",
|
| + "http://127.0.0.1:8000/security/resources/echo-referrer-header.php",
|
| + true);
|
| + xhr.onload = function () {
|
| + port.postMessage(this.responseText);
|
| + };
|
| + xhr.send();
|
| +};
|
| +
|
| +<?php
|
| }
|
| ?>
|
|
|