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

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

Issue 2780693003: [wasm] response-based compile APIs (Closed)
Patch Set: Created 3 years, 8 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
6 function TestStreamedCompile() {
7 return fetch('incrementer.wasm')
8 .then(WebAssembly.compile)
9 .then(m => new WebAssembly.Instance(m))
10 .then(i => assert_equals(5, i.exports.increment(4)));
11 }
12
13 function TestShortFormStreamedCompile() {
14 return WebAssembly.compile(fetch('incrementer.wasm'))
15 .then(m => new WebAssembly.Instance(m))
16 .then(i => assert_equals(5, i.exports.increment(4)));
17 }
18
19 function NegativeTestStreamedCompilePromise() {
20 return WebAssembly.compile(new Promise((resolve, reject)=>{resolve(5);}))
21 .then(assert_unreached,
22 e => assert_true(e instanceof TypeError));
23 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698