From c7cc4bc5c8117747610b2aa75fd9837f0f64a0ef Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Thu, 12 Nov 2015 18:44:51 +0100 Subject: [PATCH] Backed out changesets 5a3092c456c0,8dcbfd14f1e5 (bug 1218433) for M3, W3 failures and M10 failure on Android. r=backout * * * Backed out changeset 8dcbfd14f1e5 (bug 1218433) 462 INFO TEST-UNEXPECTED-FAIL | dom/security/test/csp/test_child-src_worker-redirect.html | CSP child-src worker test other-src-worker_redir-same - got "Error: Failed to load script (nsresult = 0x805e0006)", expected "blocked" 479 INFO TEST-UNEXPECTED-FAIL | dom/security/test/csp/test_child-src_worker.html | Test timed out. 486 INFO TEST-UNEXPECTED-FAIL | dom/security/test/csp/test_child-src_worker_data.html | Test timed out. --- dom/html/test/file_iframe_sandbox_g_if1.html | 9 +- .../general/frameStoragePrevented.html | 24 +- dom/workers/ScriptLoader.cpp | 211 +++++++++--------- dom/workers/test/test_csp.js | 6 +- dom/workers/test/test_loadError.html | 76 ++++--- .../SharedWorker/same-origin.html.ini | 4 + .../constructors/Worker/same-origin.html.ini | 4 + .../WorkerUtils/importScripts/004.html.ini | 4 + .../WorkerUtils/importScripts/006.html.ini | 6 + .../self-doesnt-match-blob.sub.html | 4 - .../star-doesnt-match-blob.sub.html | 4 - .../child-src-worker-blocked.sub.html | 3 - .../tests/mixed-content/generic/common.js | 3 +- .../Worker_cross_origin_security_err.htm | 13 +- .../SharedWorker/same-origin.html | 47 ++-- .../constructors/Worker/same-origin.html | 40 ++-- 16 files changed, 213 insertions(+), 245 deletions(-) create mode 100644 testing/web-platform/meta/workers/interfaces/WorkerUtils/importScripts/004.html.ini create mode 100644 testing/web-platform/meta/workers/interfaces/WorkerUtils/importScripts/006.html.ini diff --git a/dom/html/test/file_iframe_sandbox_g_if1.html b/dom/html/test/file_iframe_sandbox_g_if1.html index 9a985faf9749..90ca6074acf3 100644 --- a/dom/html/test/file_iframe_sandbox_g_if1.html +++ b/dom/html/test/file_iframe_sandbox_g_if1.html @@ -42,9 +42,14 @@ // test loading with relative url - this should fail since we are // sandboxed and have a null principal - var worker_js = new Worker('file_iframe_sandbox_worker.js'); + try { + var worker_js = new Worker('file_iframe_sandbox_worker.js'); + } catch (e) { + ok(e.name === "SecurityError", "a worker in a sandboxed document should throw when loading from a relative URI"); + } + worker_js.onerror = function(error) { - ok(true, "a worker in a sandboxed document should tell the load error via error event"); + ok(false, "a worker in a sandboxed document should not tell the load error via error event"); } worker_js.addEventListener('message', function(event) { diff --git a/dom/tests/mochitest/general/frameStoragePrevented.html b/dom/tests/mochitest/general/frameStoragePrevented.html index 3554d6082c85..b29cf2c9d027 100644 --- a/dom/tests/mochitest/general/frameStoragePrevented.html +++ b/dom/tests/mochitest/general/frameStoragePrevented.html @@ -4,7 +4,7 @@ frame for storage prevented test -
diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html b/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html index 2e0dd8db33a7..196b53bedbe8 100644 --- a/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html +++ b/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html @@ -12,54 +12,35 @@ // not propogate to the window before the tests finish setup({allow_uncaught_exception: true}); -function testSharedWorkerHelper(t, script) { - try { - var worker = new SharedWorker(script, ''); - worker.onerror = t.step_func_done(function(e) { - assert_true(e instanceof ErrorEvent); - }); - } catch (e) { - t.step_func_done(function(e) { assert_true(true); }); - } -} - test(function() { assert_throws("SecurityError", function() { new SharedWorker('unsupported:', ''); }); }, "unsupported_scheme"); - async_test(function() { var worker = new SharedWorker('data:,onconnect = function(e) { e.ports[0].postMessage(1); }', ''); worker.port.onmessage = this.step_func_done(function(e) { assert_equals(e.data, 1); }); }, "data_url"); - -async_test(function(t) { - testSharedWorkerHelper(this, 'javascript:""'); +test(function() { + assert_throws("SecurityError", function() { new SharedWorker('javascript:""', ''); }); }, "javascript_url"); - -async_test(function(t) { - testSharedWorkerHelper(this, 'about:blank'); +test(function() { + assert_throws("SecurityError", function() { new SharedWorker('about:blank', ''); }); }, "about_blank"); - -async_test(function(t) { - testSharedWorkerHelper(this, 'http://www.opera.com/'); +test(function() { + assert_throws("SecurityError", function() { new SharedWorker('http://www.opera.com/', ''); }); }, "opera_com"); - -async_test(function(t) { - testSharedWorkerHelper(this, location.protocol+'//'+location.hostname+':81/'); +test(function() { + assert_throws("SecurityError", function() { new SharedWorker(location.protocol+'//'+location.hostname+':81/', ''); }); }, "port_81"); - -async_test(function(t) { - testSharedWorkerHelper(this, 'https://'+location.hostname+':80/'); +test(function() { + assert_throws("SecurityError", function() { new SharedWorker('https://'+location.hostname+':80/', ''); }); }, "https_port_80"); - -async_test(function(t) { - testSharedWorkerHelper(this, 'https://'+location.hostname+':8000/'); +test(function() { + assert_throws("SecurityError", function() { new SharedWorker('https://'+location.hostname+':8000/', ''); }); }, "https_port_8000"); - -async_test(function(t) { - testSharedWorkerHelper(this, 'http://'+location.hostname+':8012/'); +test(function() { + assert_throws("SecurityError", function() { new SharedWorker('http://'+location.hostname+':8012/', ''); }); }, "http_port_8012");