| Index: third_party/WebKit/LayoutTests/http/tests/wasm/wasm_response_apis.js
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/wasm/wasm_response_apis.js b/third_party/WebKit/LayoutTests/http/tests/wasm/wasm_response_apis.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8aebefe1aa58b797e5d1a0b8272159f11639253c
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/wasm/wasm_response_apis.js
|
| @@ -0,0 +1,23 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +
|
| +function TestStreamedCompile() {
|
| + return fetch('incrementer.wasm')
|
| + .then(WebAssembly.compile)
|
| + .then(m => new WebAssembly.Instance(m))
|
| + .then(i => assert_equals(5, i.exports.increment(4)));
|
| +}
|
| +
|
| +function TestShortFormStreamedCompile() {
|
| + return WebAssembly.compile(fetch('incrementer.wasm'))
|
| + .then(m => new WebAssembly.Instance(m))
|
| + .then(i => assert_equals(5, i.exports.increment(4)));
|
| +}
|
| +
|
| +function NegativeTestStreamedCompilePromise() {
|
| + return WebAssembly.compile(new Promise((resolve, reject)=>{resolve(5);}))
|
| + .then(assert_unreached,
|
| + e => assert_true(e instanceof TypeError));
|
| +}
|
|
|