blob: 5e65feb904a960179bc1f92364f826e0e7365e2f [file] [log] [blame]
Eric Holk7f0a2912017-11-30 00:00:301// 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 Kasting919ce652020-05-07 10:22:366#include "content/public/test/browser_test.h"
Eric Holk7f0a2912017-11-30 00:00:307
8using extensions::Extension;
9
10// Test ensures that Wasm can run in Chrome Apps.
11namespace {
12
Devlin Cronin836f545d2018-05-09 00:25:0513using WasmAppTest = extensions::ExtensionBrowserTest;
Eric Holk7f0a2912017-11-30 00:00:3014
15IN_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
24IN_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