зеркало из https://github.com/mozilla/gecko-dev.git
Bug 978260 - Remove Assertions for mParentSuspended in Workers, r=khuey
This commit is contained in:
Родитель
722e0bc940
Коммит
acf08223bf
|
@ -2418,8 +2418,6 @@ WorkerPrivateParent<Derived>::Suspend(JSContext* aCx, nsPIDOMWindow* aWindow)
|
|||
}
|
||||
}
|
||||
|
||||
// MOZ_ASSERT(!mParentSuspended, "Suspended more than once!");
|
||||
|
||||
mParentSuspended = true;
|
||||
|
||||
{
|
||||
|
@ -2551,7 +2549,13 @@ WorkerPrivateParent<Derived>::SynchronizeAndResume(
|
|||
{
|
||||
AssertIsOnMainThread();
|
||||
MOZ_ASSERT(!GetParent());
|
||||
MOZ_ASSERT_IF(IsDedicatedWorker(), mParentSuspended);
|
||||
|
||||
if (IsDedicatedWorker() && !mParentSuspended) {
|
||||
// If we are in here, it means that this worker has been created when the
|
||||
// parent was actually suspended (maybe during a sync XHR), and in this case
|
||||
// don't need to dispatch a SynchronizeAndResumeRunnable.
|
||||
return true;
|
||||
}
|
||||
|
||||
// NB: There may be pending unqueued messages. If we resume here we will
|
||||
// execute those messages out of order. Instead we post an event to the
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
// Tell the main thread we're here.
|
||||
postMessage("loaded");
|
|
@ -2,6 +2,7 @@
|
|||
support-files =
|
||||
WorkerTest_badworker.js
|
||||
atob_worker.js
|
||||
bug978260_worker.js
|
||||
bug1014466_data1.txt
|
||||
bug1014466_data2.txt
|
||||
bug1014466_worker.js
|
||||
|
@ -186,6 +187,7 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #bug 982828
|
|||
[test_websocket_loadgroup.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #bug 982828
|
||||
[test_bug1062920.html]
|
||||
[test_bug978260.html]
|
||||
[test_webSocket_sharedWorker.html]
|
||||
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s #bug 982828
|
||||
[test_websocket_pref.html]
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for DOM Worker Threads</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onload = function () {
|
||||
var worker = new Worker("bug978260_worker.js");
|
||||
worker.onmessage = function(event) {
|
||||
is(event.data, "loaded");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
||||
xhr.open('GET', '/', false);
|
||||
xhr.send();
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче