Skip to content

Commit

Permalink
Backed out 2 changesets (bug 1218433) for wpt failures CLOSED TREE
Browse files Browse the repository at this point in the history
Backed out changeset 1cc8cc0444c0 (bug 1218433)
Backed out changeset 5418ca0e0378 (bug 1218433)

--HG--
extra : commitid : H1h8VHrzxx8
  • Loading branch information
KWierso committed Nov 16, 2015
1 parent 7ebb7aa commit 9d1f194
Show file tree
Hide file tree
Showing 32 changed files with 172 additions and 282 deletions.
9 changes: 7 additions & 2 deletions dom/html/test/file_iframe_sandbox_g_if1.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@
page_id);
worker.port.start();

worker.onerror = function(evt) {
evt.preventDefault();
window.parent.postMessage({id:page_id, message:"blocked"},
'http://mochi.test:8888');
}

worker.port.onmessage = function(ev) {
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
};
Expand Down
6 changes: 0 additions & 6 deletions dom/security/test/csp/file_child-src_shared_worker.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
page_id);
worker.port.start();

worker.onerror = function(evt) {
evt.preventDefault();
window.parent.postMessage({id:page_id, message:"blocked"},
'http://mochi.test:8888');
}

worker.port.onmessage = function(ev) {
window.parent.postMessage({id:page_id, message:"allowed"},
'http://mochi.test:8888');
Expand Down
5 changes: 0 additions & 5 deletions dom/security/test/csp/file_child-src_shared_worker_data.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
escape(shared_worker), page_id);
worker.port.start();

worker.onerror = function(evt) {
evt.preventDefault();
window.parent.postMessage({id:page_id, message:"blocked"}, 'http://mochi.test:8888');
}

worker.port.onmessage = function(ev) {
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
};
Expand Down
3 changes: 1 addition & 2 deletions dom/security/test/csp/file_child-src_worker-redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@

worker.onerror = function(error) {
var msg = error.message;
if (msg.match(/^: NetworkError/) || msg.match(/Failed to load script/)) {
if (msg.match(/^: NetworkError/)) {
// this means CSP blocked it
msg = "blocked";
}
window.parent.postMessage({id:page_id, message:msg}, 'http://mochi.test:8888');
error.preventDefault();
};

worker.onmessage = function(ev) {
Expand Down
9 changes: 1 addition & 8 deletions dom/security/test/csp/file_child-src_worker.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@
page_id = window.location.hash.substring(1);
try {
worker = new Worker('file_testserver.sjs?file='+escape("tests/dom/security/test/csp/file_child-src_worker.js"));

worker.onerror = function(e) {
window.parent.postMessage({id:page_id, message:"blocked"}, 'http://mochi.test:8888');
e.preventDefault();
}

worker.onmessage = function(ev) {
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
}

};
worker.postMessage('foo');
}
catch (e) {
Expand Down
9 changes: 1 addition & 8 deletions dom/security/test/csp/file_child-src_worker_data.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@
page_id = window.location.hash.substring(1);
try {
worker = new Worker('data:application/javascript;charset=UTF-8,'+escape('onmessage = function(e) { postMessage("worker"); };'));

worker.onerror = function(e) {
window.parent.postMessage({id:page_id, message:"blocked"}, 'http://mochi.test:8888');
e.preventDefault();
}

worker.onmessage = function(ev) {
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
}

};
worker.postMessage('foo');
}
catch (e) {
Expand Down
24 changes: 6 additions & 18 deletions dom/tests/mochitest/general/frameStoragePrevented.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>frame for storage prevented test</title>

<script type="text/javascript" src="https://example.com/tests/dom/tests/mochitest/general/storagePermissionsUtils.js"></script>
<script type="text/javascript;version=1.7">
<script type="text/javascript">

task(function* () {
// We shouldn't be able to access storage
Expand All @@ -13,24 +13,12 @@
// This hash of the URI is set to #nullprincipal by the test if the current page has a null principal,
// and thus attempting to create a dedicated worker will throw
if (location.hash == "#nullprincipal") {
function createWorker() {
return new Promise((resolve, reject) => {
var w;
try {
w = new Worker("workerStoragePrevented.js");
} catch (e) {
ok(true, "Running workers was prevented");
resolve();
}

w.onerror = function() {
ok(true, "Running workers was prevented");
resolve();
}
});
try {
new Worker("workerStoragePrevented.js");
ok(false, "Running workers should not have been allowed");
} catch (e) {
ok(true, "Running workers was prevented");
}

yield createWorker();
return;
}

Expand Down
Loading

0 comments on commit 9d1f194

Please sign in to comment.