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

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

Issue 2643723010: [d8] Use ValueSerializer for postMessage (instead of ad-hoc serializer) (Closed)
Patch Set: forgot hash_combine Created 3 years, 11 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
Index: test/mjsunit/d8-worker-sharedarraybuffer.js
diff --git a/test/mjsunit/d8-worker-sharedarraybuffer.js b/test/mjsunit/d8-worker-sharedarraybuffer.js
index 3fe9fdd143b1eab5eabe85ff57dcf908e524a39f..09586c3a11c7bcebb3d8aca5e41680784c528b3e 100644
--- a/test/mjsunit/d8-worker-sharedarraybuffer.js
+++ b/test/mjsunit/d8-worker-sharedarraybuffer.js
@@ -28,20 +28,19 @@
// Flags: --harmony-sharedarraybuffer
if (this.Worker) {
-
(function TestTransfer() {
var workerScript =
`onmessage = function(m) {
- var sab = m;
- var ta = new Uint32Array(sab);
- if (sab.byteLength !== 16) {
- throw new Error('SharedArrayBuffer transfer byteLength');
- }
- for (var i = 0; i < 4; ++i) {
- if (ta[i] !== i) {
- throw new Error('SharedArrayBuffer transfer value ' + i);
- }
- }
+ var sab = m;
+ var ta = new Uint32Array(sab);
+ if (sab.byteLength !== 16) {
+ throw new Error('SharedArrayBuffer transfer byteLength');
+ }
+ for (var i = 0; i < 4; ++i) {
+ if (ta[i] !== i) {
+ throw new Error('SharedArrayBuffer transfer value ' + i);
+ }
+ }
// Atomically update ta[0]
Atomics.store(ta, 0, 100);
};`;
@@ -55,7 +54,7 @@ if (this.Worker) {
}
// Transfer SharedArrayBuffer
- w.postMessage(sab, [sab]);
+ w.postMessage(sab);
assertEquals(16, sab.byteLength); // ArrayBuffer should not be neutered.
// Spinwait for the worker to update ta[0]
@@ -86,7 +85,7 @@ if (this.Worker) {
var workers = [];
for (id = 0; id < 4; ++id) {
workers[id] = new Worker(workerScript);
- workers[id].postMessage({sab: sab, id: id}, [sab]);
+ workers[id].postMessage({sab: sab, id: id});
}
// Spinwait for each worker to update ta[id]

Powered by Google App Engine
This is Rietveld 408576698