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

Unified 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, 9 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: 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));
+}

Powered by Google App Engine
This is Rietveld 408576698