зеркало из https://github.com/mozilla/gecko-dev.git
Bug 912086 - Several Workers methods do not set their return value. r=mrbkap
--HG-- rename : dom/workers/test/bug911085_worker.js => dom/workers/test/rvals_worker.js rename : dom/workers/test/test_bug911085.html => dom/workers/test/test_rvals.html
This commit is contained in:
Родитель
08780fe947
Коммит
c4d9d86152
|
@ -270,7 +270,12 @@ private:
|
|||
return !JS_IsExceptionPending(aCx);
|
||||
}
|
||||
|
||||
return worker->Terminate(aCx);
|
||||
if (!worker->Terminate(aCx)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JS_RVAL(aCx, aVp).setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
@ -400,7 +400,12 @@ private:
|
|||
return false;
|
||||
}
|
||||
|
||||
return scope->mWorker->CloseInternal(aCx);
|
||||
if (!scope->mWorker->CloseInternal(aCx)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JS_RVAL(aCx, aVp).setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -420,6 +425,7 @@ private:
|
|||
return false;
|
||||
}
|
||||
|
||||
JS_RVAL(aCx, aVp).setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -462,7 +468,12 @@ private:
|
|||
return false;
|
||||
}
|
||||
|
||||
return scope->mWorker->ClearTimeout(aCx, id);
|
||||
if (!scope->mWorker->ClearTimeout(aCx, id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JS_RVAL(aCx, aVp).setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -504,7 +515,12 @@ private:
|
|||
return false;
|
||||
}
|
||||
|
||||
return scope->mWorker->ClearTimeout(aCx, id);
|
||||
if (!scope->mWorker->ClearTimeout(aCx, id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JS_RVAL(aCx, aVp).setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -537,6 +553,7 @@ private:
|
|||
fflush(stdout);
|
||||
}
|
||||
|
||||
JS_RVAL(aCx, aVp).setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -106,8 +106,8 @@ MOCHITEST_FILES = \
|
|||
content_worker.js \
|
||||
test_url.html \
|
||||
url_worker.js \
|
||||
test_bug911085.html \
|
||||
bug911085_worker.js \
|
||||
test_rvals.html \
|
||||
rvals_worker.js \
|
||||
test_urlApi.html \
|
||||
urlApi_worker.js \
|
||||
$(NULL)
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
onmessage = function(evt) {
|
||||
postMessage(postMessage('ignore') == undefined);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
onmessage = function(evt) {
|
||||
postMessage(postMessage('ignore') == undefined);
|
||||
|
||||
var id = setInterval(function() {}, 200);
|
||||
postMessage(clearInterval(id) == undefined);
|
||||
|
||||
id = setTimeout(function() {}, 200);
|
||||
postMessage(clearTimeout(id) == undefined);
|
||||
|
||||
postMessage(dump(42) == undefined);
|
||||
|
||||
postMessage('finished');
|
||||
}
|
|
@ -12,13 +12,18 @@
|
|||
<body>
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
var worker = new Worker("bug911085_worker.js");
|
||||
var worker = new Worker("rvals_worker.js");
|
||||
|
||||
worker.onmessage = function(event) {
|
||||
if (event.data == 'ignore') return;
|
||||
|
||||
ok(event.data, "postMessage() returns 'undefined' in workers");
|
||||
SimpleTest.finish();
|
||||
if (event.data == 'finished') {
|
||||
is(worker.terminate(), undefined, "Terminate() returns 'undefined'");
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
ok(event.data, "something good returns 'undefined' in workers");
|
||||
};
|
||||
|
||||
is(worker.postMessage(42), undefined, "PostMessage() returns 'undefined' on main thread");
|
Загрузка…
Ссылка в новой задаче