Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[GTK] Problem running promises code in workers
https://bugs.webkit.org/show_bug.cgi?id=152340 Reviewed by Carlos Garcia Campos. Test file that creates two testharness promise tests. Each test creates 10000 promises, pushes them into an array and vends them in a timeout. * js/promises-tests/promises-in-workers-expected.txt: Added. * js/promises-tests/promises-in-workers.html: Added. * js/promises-tests/promises-in-workers.js: Added. Canonical link: https://commits.webkit.org/171610@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,4 @@ | ||
|
||
PASS Test | ||
PASS Test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,6 @@ | ||
<script src="../../resources/testharness.js"></script> | ||
<script src="../../resources/testharnessreport.js"></script> | ||
<script> | ||
'use strict'; | ||
fetch_tests_from_worker(new Worker('promises-in-workers.js')); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
if (self.importScripts) { | ||
self.importScripts('../../resources/testharness.js'); | ||
} | ||
|
||
var a = []; | ||
|
||
// Changing from 2 to 1 makes the test pass. | ||
for (let i = 0; i < 2; i++) { | ||
promise_test(t => { | ||
|
||
for (let j = 0; j < 10000; j++) | ||
a.push(new Promise(function() {})); | ||
|
||
return new Promise(resolve => step_timeout(resolve, 500)); | ||
|
||
}, 'Test'); | ||
} | ||
|
||
done(); |