Bug 1218433 - Use AsyncOpen2 in dom/workers/ScriptLoader.cpp - part 2 - WPT, r=sicking, r=Ms2ger
This commit is contained in:
@@ -23,6 +23,12 @@
|
|||||||
page_id);
|
page_id);
|
||||||
worker.port.start();
|
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) {
|
worker.port.onmessage = function(ev) {
|
||||||
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
|
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,6 +13,12 @@
|
|||||||
page_id);
|
page_id);
|
||||||
worker.port.start();
|
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) {
|
worker.port.onmessage = function(ev) {
|
||||||
window.parent.postMessage({id:page_id, message:"allowed"},
|
window.parent.postMessage({id:page_id, message:"allowed"},
|
||||||
'http://mochi.test:8888');
|
'http://mochi.test:8888');
|
||||||
|
|||||||
@@ -18,6 +18,11 @@
|
|||||||
escape(shared_worker), page_id);
|
escape(shared_worker), page_id);
|
||||||
worker.port.start();
|
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) {
|
worker.port.onmessage = function(ev) {
|
||||||
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
|
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,11 +24,12 @@
|
|||||||
|
|
||||||
worker.onerror = function(error) {
|
worker.onerror = function(error) {
|
||||||
var msg = error.message;
|
var msg = error.message;
|
||||||
if (msg.match(/^: NetworkError/)) {
|
if (msg.match(/^: NetworkError/) || msg.match(/Failed to load script/)) {
|
||||||
// this means CSP blocked it
|
// this means CSP blocked it
|
||||||
msg = "blocked";
|
msg = "blocked";
|
||||||
}
|
}
|
||||||
window.parent.postMessage({id:page_id, message:msg}, 'http://mochi.test:8888');
|
window.parent.postMessage({id:page_id, message:msg}, 'http://mochi.test:8888');
|
||||||
|
error.preventDefault();
|
||||||
};
|
};
|
||||||
|
|
||||||
worker.onmessage = function(ev) {
|
worker.onmessage = function(ev) {
|
||||||
|
|||||||
@@ -8,9 +8,16 @@
|
|||||||
page_id = window.location.hash.substring(1);
|
page_id = window.location.hash.substring(1);
|
||||||
try {
|
try {
|
||||||
worker = new Worker('file_testserver.sjs?file='+escape("tests/dom/security/test/csp/file_child-src_worker.js"));
|
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) {
|
worker.onmessage = function(ev) {
|
||||||
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
|
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
|
||||||
};
|
}
|
||||||
|
|
||||||
worker.postMessage('foo');
|
worker.postMessage('foo');
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|||||||
@@ -8,9 +8,16 @@
|
|||||||
page_id = window.location.hash.substring(1);
|
page_id = window.location.hash.substring(1);
|
||||||
try {
|
try {
|
||||||
worker = new Worker('data:application/javascript;charset=UTF-8,'+escape('onmessage = function(e) { postMessage("worker"); };'));
|
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) {
|
worker.onmessage = function(ev) {
|
||||||
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
|
window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888');
|
||||||
};
|
}
|
||||||
|
|
||||||
worker.postMessage('foo');
|
worker.postMessage('foo');
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[self-doesnt-match-blob.sub.html]
|
||||||
|
type: testharness
|
||||||
|
expected: ERROR
|
||||||
|
|
||||||
|
[Violation report status OK.]
|
||||||
|
expected: PASS
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[star-doesnt-match-blob.sub.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
[child-src-worker-blocked.sub.html]
|
||||||
|
type: testharness
|
||||||
|
expected: ERROR
|
||||||
|
|
||||||
|
[Expecting alerts: ["PASS"\]]
|
||||||
|
expected: PASS
|
||||||
|
expected: NOTRUN
|
||||||
|
|
||||||
|
[Violation report status OK.]
|
||||||
|
expected: PASS
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[no-opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[no-opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[no-opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[no-opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[no-opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[no-opt-in-blocks.https.html]
|
||||||
|
expected: ERROR
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
[Worker_cross_origin_security_err.htm]
|
||||||
|
type: testharness
|
||||||
|
[ Worker cross-origin URL ]
|
||||||
|
expected: FAIL
|
||||||
@@ -1,8 +1,26 @@
|
|||||||
[same-origin.html]
|
[same-origin.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
|
|
||||||
[unsupported_scheme]
|
[unsupported_scheme]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[javascript_url]
|
[javascript_url]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[about_blank]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[opera_com]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[port_81]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[https_port_80]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[https_port_8000]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[http_port_8012]
|
||||||
|
expected: FAIL
|
||||||
|
|||||||
@@ -6,3 +6,20 @@
|
|||||||
[javascript_url]
|
[javascript_url]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[about_blank]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[example_invalid]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[port_81]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[https_port_80]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[https_port_8000]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
[http_post_8012]
|
||||||
|
expected: FAIL
|
||||||
|
|||||||
Reference in New Issue
Block a user