| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 // Copyright 2016 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 "base/command_line.h" | 
|  | 6 #include "base/macros.h" | 
|  | 7 #include "chrome/browser/devtools/device/adb/adb_device_provider.h" | 
|  | 8 #include "chrome/browser/devtools/device/adb/mock_adb_server.h" | 
|  | 9 #include "chrome/browser/devtools/device/devtools_android_bridge.h" | 
|  | 10 #include "chrome/browser/ui/browser.h" | 
|  | 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 
|  | 12 #include "chrome/common/url_constants.h" | 
|  | 13 #include "chrome/test/base/ui_test_utils.h" | 
|  | 14 #include "chrome/test/base/web_ui_browser_test.h" | 
|  | 15 #include "content/public/browser/navigation_details.h" | 
|  | 16 #include "content/public/browser/web_contents.h" | 
|  | 17 #include "content/public/common/content_switches.h" | 
|  | 18 #include "content/public/test/browser_test_utils.h" | 
|  | 19 #include "net/test/embedded_test_server/embedded_test_server.h" | 
|  | 20 | 
|  | 21 using content::WebContents; | 
|  | 22 | 
|  | 23 class WasmSerializationBrowserTest : public InProcessBrowserTest { | 
|  | 24  public: | 
|  | 25   WasmSerializationBrowserTest() {} | 
|  | 26   ~WasmSerializationBrowserTest() override {} | 
|  | 27 | 
|  | 28   void SetUpCommandLine(base::CommandLine* command_line) override { | 
|  | 29     command_line->AppendSwitch(switches::kEnableWasm); | 
|  | 30     InProcessBrowserTest::SetUpCommandLine(command_line); | 
|  | 31   } | 
|  | 32 | 
|  | 33   void SetUp() override { | 
|  | 34     embedded_test_server()->ServeFilesFromSourceDirectory("chrome/test/data"); | 
|  | 35     embedded_test_server()->ServeFilesFromSourceDirectory("v8/test/mjsunit"); | 
|  | 36 | 
|  | 37     ASSERT_TRUE(embedded_test_server()->Start()); | 
|  | 38 | 
|  | 39     test_url_ = embedded_test_server()->GetURL("/wasm/wasm_tests.html"); | 
|  | 40     InProcessBrowserTest::SetUp(); | 
|  | 41   } | 
|  | 42 | 
|  | 43   GURL test_url() const { return test_url_; } | 
|  | 44 | 
|  | 45  private: | 
|  | 46   GURL test_url_; | 
|  | 47   DISALLOW_COPY_AND_ASSIGN(WasmSerializationBrowserTest); | 
|  | 48 }; | 
|  | 49 | 
|  | 50 IN_PROC_BROWSER_TEST_F(WasmSerializationBrowserTest, RoundtripTest) { | 
|  | 51   ASSERT_TRUE(embedded_test_server()->Started()); | 
|  | 52   ui_test_utils::NavigateToURL(browser(), test_url()); | 
|  | 53   content::WebContents* web_contents = | 
|  | 54       browser()->tab_strip_model()->GetActiveWebContents(); | 
|  | 55   int result = 0; | 
|  | 56   EXPECT_TRUE(content::ExecuteScriptAndExtractInt( | 
|  | 57       web_contents->GetMainFrame(), "test_instantiateInWorker()", &result)); | 
|  | 58   EXPECT_EQ(43, result); | 
|  | 59 } | 
| OLD | NEW | 
|---|