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

Side by Side Diff: chrome/test/data/wasm/wasm_tests.js

Issue 2255673003: [wasm] Support wasm module structured cloning. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Setup isolate Created 4 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Utility function. Use this to return data back to the C++ test.
6 function respondToTestHarness(data) {
7 if (!window.domAutomationController) {
8 console.log("ERROR: no automation controller available");
9 return;
10 }
11 window.domAutomationController.send(data);
12 }
13
14 function test_instantiateInWorker() {
15 fetch('incrementer.wasm')
16 .then(response => {
17 if (!response.ok) throw new Error(response.statusText);
18 return response.arrayBuffer();
19 })
20 .then(data => {
21 var mod = new WebAssembly.Module(data);
22 var worker = new Worker("wasm_serialization_worker.js");
23 worker.postMessage(mod);
24 worker.onmessage = function(event) {
25 respondToTestHarness(event.data);
26 }
27 })
28 .catch(error => respondToTestHarness(error.message));
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698