Eric Holk | 7f0a291 | 2017-11-30 00:00:30 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/browser/extensions/extension_browsertest.h" |
Peter Kasting | 919ce65 | 2020-05-07 10:22:36 | [diff] [blame] | 6 | #include "content/public/test/browser_test.h" |
Eric Holk | 7f0a291 | 2017-11-30 00:00:30 | [diff] [blame] | 7 | |
| 8 | using extensions::Extension; |
| 9 | |
| 10 | // Test ensures that Wasm can run in Chrome Apps. |
| 11 | namespace { |
| 12 | |
Devlin Cronin | 836f545d | 2018-05-09 00:25:05 | [diff] [blame] | 13 | using WasmAppTest = extensions::ExtensionBrowserTest; |
Eric Holk | 7f0a291 | 2017-11-30 00:00:30 | [diff] [blame] | 14 | |
| 15 | IN_PROC_BROWSER_TEST_F(WasmAppTest, InstantiateWasmFromFetch) { |
| 16 | const Extension* extension = |
| 17 | LoadExtension(test_data_dir_.AppendASCII("wasm_app")); |
| 18 | ASSERT_TRUE(extension); |
| 19 | |
| 20 | EXPECT_EQ("success", ExecuteScriptInBackgroundPage(extension->id(), |
| 21 | "instantiateFetch()")); |
| 22 | } |
| 23 | |
| 24 | IN_PROC_BROWSER_TEST_F(WasmAppTest, InstantiateWasmFromArrayBuffer) { |
| 25 | const Extension* extension = |
| 26 | LoadExtension(test_data_dir_.AppendASCII("wasm_app")); |
| 27 | ASSERT_TRUE(extension); |
| 28 | |
| 29 | EXPECT_EQ("success", ExecuteScriptInBackgroundPage( |
| 30 | extension->id(), "instantiateArrayBuffer()")); |
| 31 | } |
| 32 | |
| 33 | } // namespace |