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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/wasm/wasm_serialization_tests.js

Issue 2255673003: [wasm] Support wasm module structured cloning. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: LayoutTests and virtual path Created 4 years, 3 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 function instantiateInWorker() {
6 // the file incrementer.wasm is copied from
7 // //v8/test/mjsunit/wasm. This is because currently we cannot
8 // reference files outside the LayoutTests folder. When wasm format
9 // changes require that file to be updated, there is a test on the
10 // v8 side (same folder), ensure-wasm-binaries-up-to-date.js, which
11 // fails and will require incrementer.wasm to be updated on that side.
12 return fetch('incrementer.wasm')
13 .then(response => {
14 if (!response.ok) throw new Error(response.statusText);
15 return response.arrayBuffer();
16 })
17 .then(data => {
18 var mod = new WebAssembly.Module(data);
19 var worker = new Worker("wasm_serialization_worker.js");
20 return new Promise((resolve, reject) => {
21 worker.postMessage(mod);
22 worker.onmessage = function(event) {
23 resolve(event.data);
24 }
25 });
26 })
27 .then(data => assert_equals(data, 43))
28 .catch(error => assert_unreached(error));
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698