Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(599)

Unified Diff: test/mjsunit/d8-worker-spawn-worker.js

Issue 1208733002: Fix cluster-fuzz regression when getting message from Worker (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: don't remove Worker from workers_ on terminate Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/d8-worker.js ('k') | test/mjsunit/regress/regress-crbug-504136.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/d8-worker-spawn-worker.js
diff --git a/test/mjsunit/compiler/osr-nested.js b/test/mjsunit/d8-worker-spawn-worker.js
similarity index 79%
copy from test/mjsunit/compiler/osr-nested.js
copy to test/mjsunit/d8-worker-spawn-worker.js
index 4bdb0828ca2272332701c579bcbf9952cf43e6a4..b9d7f9ade4fd116837c275a73867eeda26076e5a 100644
--- a/test/mjsunit/compiler/osr-nested.js
+++ b/test/mjsunit/d8-worker-spawn-worker.js
@@ -1,4 +1,4 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
+// Copyright 2015 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -25,22 +25,22 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --use-osr
+if (this.Worker) {
+ function f() {
+ var g = function () {
+ postMessage(42);
+ };
-function f() {
- var sum = 0;
- for (var i = 0; i < 10; i++) {
- for (var j = 0; j < 100000; j++) {
- var x = i + 2;
- var y = x + 5;
- var z = y + 3;
- sum += z;
- }
- }
- return sum;
-}
+ var w = new Worker(g);
+ onmessage = function(parentMsg) {
+ w.postMessage(parentMsg);
+ var childMsg = w.getMessage();
+ postMessage(childMsg);
+ };
+ }
-assertEquals(14500000, f());
-assertEquals(14500000, f());
-assertEquals(14500000, f());
+ var w = new Worker(f);
+ w.postMessage(9);
+ assertEquals(42, w.getMessage());
+}
« no previous file with comments | « test/mjsunit/d8-worker.js ('k') | test/mjsunit/regress/regress-crbug-504136.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698