Bug 1121519, fix racy test, r=jgraham.

This commit is contained in:
Ben Turner 2015-01-14 11:43:31 -08:00
parent 889a67cbfd
commit a9f507428f

View File

@ -13,14 +13,10 @@ postMessage(2);
async_test(function() {
var worker = new Worker('#');
var i = 0;
var timeout = setTimeout(this.step_func(function(e) {
assert_equals(i, 2);
}), 500);
worker.onmessage = this.step_func(function(e) {
i++;
assert_equals(e.data, i);
if (i == 2) {
clearTimeout(timeout);
this.done();
}
});
@ -28,4 +24,4 @@ async_test(function() {
</script>
<!--
*/
//-->
//-->