зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1132395 - URL.createObjectURL must be able to work with workers without parents, r=smaug
This commit is contained in:
Родитель
32b36a8170
Коммит
2ba37fdfb5
|
@ -135,7 +135,8 @@ public:
|
|||
|
||||
principal = doc->NodePrincipal();
|
||||
} else {
|
||||
MOZ_ASSERT_IF(!mWorkerPrivate->GetParent(), mWorkerPrivate->IsChromeWorker());
|
||||
// We use the worker Principal in case this is a SharedWorker, a
|
||||
// ChromeWorker or a ServiceWorker.
|
||||
principal = mWorkerPrivate->GetPrincipal();
|
||||
}
|
||||
|
||||
|
@ -191,7 +192,8 @@ public:
|
|||
|
||||
principal = doc->NodePrincipal();
|
||||
} else {
|
||||
MOZ_ASSERT_IF(!mWorkerPrivate->GetParent(), mWorkerPrivate->IsChromeWorker());
|
||||
// We use the worker Principal in case this is a SharedWorker, a
|
||||
// ChromeWorker or a ServiceWorker.
|
||||
principal = mWorkerPrivate->GetPrincipal();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
onconnect = function(evt) {
|
||||
var blob = new Blob(['123'], { type: 'text/plain' });
|
||||
var url = URL.createObjectURL(blob);
|
||||
evt.ports[0].postMessage('alive \\o/');
|
||||
}
|
|
@ -98,6 +98,7 @@ support-files =
|
|||
webSocket_sharedWorker.js
|
||||
bug1104064_worker.js
|
||||
worker_consoleAndBlobs.js
|
||||
bug1132395_sharedWorker.js
|
||||
|
||||
[test_404.html]
|
||||
[test_atob.html]
|
||||
|
@ -199,3 +200,4 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #bug 982828
|
|||
[test_websocket_pref.html]
|
||||
[test_bug1104064.html]
|
||||
[test_consoleAndBlobs.html]
|
||||
[test_bug1132395.html]
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for 1132395</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SpecialPowers.pushPrefEnv({ set: [["dom.workers.sharedWorkers.enabled", true]] }, function() {
|
||||
var sw = new SharedWorker('bug1132395_sharedWorker.js');
|
||||
sw.port.onmessage = function(event) {
|
||||
ok(true, "We didn't crash.");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
});
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче