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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/wasm/wasm-limits-tests.js

Issue 2808743005: [wasm] Compile closer to how customers will. (Closed)
Patch Set: [wasm] Compile closer to how customers will. 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var limit = Math.pow(2, 12); 5 var limit = Math.pow(2, 12);
6 6
7 function NoParameters() { 7 function NoParameters() {
8 function ExpectTypeError(f) { 8 function ExpectTypeError(f) {
9 try { 9 try {
10 f(); 10 f();
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 function TestPromiseCompileAsyncInstantiateFromModule() { 86 function TestPromiseCompileAsyncInstantiateFromModule() {
87 return WebAssembly.compile(createTestBuffers(limit).large) 87 return WebAssembly.compile(createTestBuffers(limit).large)
88 .then(m => { 88 .then(m => {
89 assert_true(m instanceof WebAssembly.Module); 89 assert_true(m instanceof WebAssembly.Module);
90 return WebAssembly.instantiate(m). 90 return WebAssembly.instantiate(m).
91 then(i => assert_true(i instanceof WebAssembly.Instance), 91 then(i => assert_true(i instanceof WebAssembly.Instance),
92 assert_unreached); 92 assert_unreached);
93 }, 93 },
94 assert_unreached); 94 assert_unreached);
95 } 95 }
96
97
98 function TestCompileFromPromise() {
99 return Promise.resolve(createTestBuffers(limit).large)
100 .then(WebAssembly.compile)
101 .then(m => assert_true(m instanceof WebAssembly.Module))
102 }
103
104 function TestInstantiateFromPromise() {
105 return Promise.resolve(createTestBuffers(limit).large)
106 .then(WebAssembly.instantiate)
107 .then(pair => {
108 assert_true(pair.module instanceof WebAssembly.Module);
109 assert_true(pair.instance instanceof WebAssembly.Instance);
110 });
111 }
112
113 function TestInstantiateFromPromiseChain() {
114 return Promise.resolve(createTestBuffers(limit).large)
115 .then(WebAssembly.compile)
116 .then(WebAssembly.instantiate)
117 .then(i => assert_true(i instanceof WebAssembly.Instance))
118 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698