1 // Copyright (c) 2013 Intel Corporation. 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.
5 #include "base/command_line.h"
6 #include "base/strings/utf_string_conversions.h"
7 #include "xwalk/runtime/browser/runtime.h"
8 #include "xwalk/test/base/in_process_browser_test.h"
9 #include "xwalk/test/base/xwalk_test_utils.h"
10 #include "content/public/common/content_switches.h"
11 #include "content/public/browser/navigation_entry.h"
12 #include "content/public/test/browser_test_utils.h"
13 #include "content/public/test/test_utils.h"
14 #include "content/public/browser/web_contents.h"
15 #include "net/base/net_util.h"
16 #include "testing/gmock/include/gmock/gmock.h"
20 class XWalkDevToolsTest : public InProcessBrowserTest {
22 XWalkDevToolsTest() {}
23 void SetUpCommandLine(CommandLine* command_line) override {
24 command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, "9222");
25 GURL url = xwalk_test_utils::GetTestURL(
26 base::FilePath(), base::FilePath().AppendASCII("test.html"));
27 command_line->AppendArg(url.spec());
31 IN_PROC_BROWSER_TEST_F(XWalkDevToolsTest, RemoteDebugging) {
32 GURL localhost_url("http://127.0.0.1:9222");
33 Runtime* debugging_host = CreateRuntime(localhost_url);
34 content::WaitForLoadStop(debugging_host->web_contents());
35 base::string16 real_title = debugging_host->web_contents()->GetTitle();
36 base::string16 expected_title = base::ASCIIToUTF16("XWalk Remote Debugging");
37 EXPECT_EQ(expected_title, real_title);