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

Unified Diff: chrome/browser/wasm/wasm_serialization_browsertest.cc

Issue 2255673003: [wasm] Support wasm module structured cloning. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Setup isolate Created 4 years, 4 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
« DEPS ('K') | « DEPS ('k') | chrome/browser_tests.isolate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/wasm/wasm_serialization_browsertest.cc
diff --git a/chrome/browser/wasm/wasm_serialization_browsertest.cc b/chrome/browser/wasm/wasm_serialization_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..51899e1459bbcc8c4c1054275676833bc58bac4e
--- /dev/null
+++ b/chrome/browser/wasm/wasm_serialization_browsertest.cc
@@ -0,0 +1,59 @@
+// 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.
+
+#include "base/command_line.h"
+#include "base/macros.h"
+#include "chrome/browser/devtools/device/adb/adb_device_provider.h"
+#include "chrome/browser/devtools/device/adb/mock_adb_server.h"
+#include "chrome/browser/devtools/device/devtools_android_bridge.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/common/url_constants.h"
+#include "chrome/test/base/ui_test_utils.h"
+#include "chrome/test/base/web_ui_browser_test.h"
+#include "content/public/browser/navigation_details.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/common/content_switches.h"
+#include "content/public/test/browser_test_utils.h"
+#include "net/test/embedded_test_server/embedded_test_server.h"
+
+using content::WebContents;
+
+class WasmSerializationBrowserTest : public InProcessBrowserTest {
+ public:
+ WasmSerializationBrowserTest() {}
+ ~WasmSerializationBrowserTest() override {}
+
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ command_line->AppendSwitch(switches::kEnableWasm);
+ InProcessBrowserTest::SetUpCommandLine(command_line);
+ }
+
+ void SetUp() override {
+ embedded_test_server()->ServeFilesFromSourceDirectory("chrome/test/data");
+ embedded_test_server()->ServeFilesFromSourceDirectory("v8/test/mjsunit");
+
+ ASSERT_TRUE(embedded_test_server()->Start());
+
+ test_url_ = embedded_test_server()->GetURL("/wasm/wasm_tests.html");
+ InProcessBrowserTest::SetUp();
+ }
+
+ GURL test_url() const { return test_url_; }
+
+ private:
+ GURL test_url_;
+ DISALLOW_COPY_AND_ASSIGN(WasmSerializationBrowserTest);
+};
+
+IN_PROC_BROWSER_TEST_F(WasmSerializationBrowserTest, RoundtripTest) {
+ ASSERT_TRUE(embedded_test_server()->Started());
+ ui_test_utils::NavigateToURL(browser(), test_url());
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ int result = 0;
+ EXPECT_TRUE(content::ExecuteScriptAndExtractInt(
+ web_contents->GetMainFrame(), "test_instantiateInWorker()", &result));
+ EXPECT_EQ(43, result);
+}
« DEPS ('K') | « DEPS ('k') | chrome/browser_tests.isolate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698