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

Side by Side Diff: chrome/browser/devtools/devtools_sanity_browsertest.cc

Issue 912863002: [DevTools] Remote JSON requests from javascript (Chromium side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/cancelable_callback.h" 6 #include "base/cancelable_callback.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 DevToolsAgentHost::GetOrCreateFor(web_contents).get(); 919 DevToolsAgentHost::GetOrCreateFor(web_contents).get();
920 const std::string agent_id = agent_raw->GetId(); 920 const std::string agent_id = agent_raw->GetId();
921 ASSERT_EQ(agent_raw, DevToolsAgentHost::GetForId(agent_id).get()) 921 ASSERT_EQ(agent_raw, DevToolsAgentHost::GetForId(agent_id).get())
922 << "DevToolsAgentHost cannot be found by id"; 922 << "DevToolsAgentHost cannot be found by id";
923 browser()->tab_strip_model()-> 923 browser()->tab_strip_model()->
924 CloseWebContentsAt(0, TabStripModel::CLOSE_NONE); 924 CloseWebContentsAt(0, TabStripModel::CLOSE_NONE);
925 ASSERT_FALSE(DevToolsAgentHost::GetForId(agent_id).get()) 925 ASSERT_FALSE(DevToolsAgentHost::GetForId(agent_id).get())
926 << "DevToolsAgentHost is not released when the tab is closed"; 926 << "DevToolsAgentHost is not released when the tab is closed";
927 } 927 }
928 928
929 class RemoteDebuggingTest: public ExtensionApiTest { 929 class RemoteDebuggingTest : public ExtensionApiTest {
930 void SetUpCommandLine(base::CommandLine* command_line) override { 930 void SetUpCommandLine(base::CommandLine* command_line) override {
931 ExtensionApiTest::SetUpCommandLine(command_line); 931 ExtensionApiTest::SetUpCommandLine(command_line);
932 command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, "9222"); 932 command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, "9222");
933 933
934 // Override the extension root path. 934 // Override the extension root path.
935 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); 935 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_);
936 test_data_dir_ = test_data_dir_.AppendASCII("devtools"); 936 test_data_dir_ = test_data_dir_.AppendASCII("devtools");
937 } 937 }
938 }; 938 };
939 939
940 // Fails on CrOS. crbug.com/431399 940 // Fails on CrOS. crbug.com/431399
941 #if defined(OS_CHROMEOS) 941 #if defined(OS_CHROMEOS)
942 #define MAYBE_RemoteDebugger DISABLED_RemoteDebugger 942 #define MAYBE_RemoteDebugger DISABLED_RemoteDebugger
943 #else 943 #else
944 #define MAYBE_RemoteDebugger RemoteDebugger 944 #define MAYBE_RemoteDebugger RemoteDebugger
945 #endif 945 #endif
946 IN_PROC_BROWSER_TEST_F(RemoteDebuggingTest, MAYBE_RemoteDebugger) { 946 IN_PROC_BROWSER_TEST_F(RemoteDebuggingTest, MAYBE_RemoteDebugger) {
947 #if defined(OS_WIN) && defined(USE_ASH) 947 #if defined(OS_WIN) && defined(USE_ASH)
948 // Disable this test in Metro+Ash for now (http://crbug.com/262796). 948 // Disable this test in Metro+Ash for now (http://crbug.com/262796).
949 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 949 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
950 switches::kAshBrowserTests)) 950 switches::kAshBrowserTests))
951 return; 951 return;
952 #endif 952 #endif
953 953
954 ASSERT_TRUE(RunExtensionTest("target_list")) << message_; 954 ASSERT_TRUE(RunExtensionTest("target_list")) << message_;
955 } 955 }
956
957 class RemoteWebSocketTest : public DevToolsSanityTest {
958 void SetUpCommandLine(base::CommandLine* command_line) override {
959 DevToolsSanityTest::SetUpCommandLine(command_line);
960 command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, "9222");
961 }
962 };
963
964 IN_PROC_BROWSER_TEST_F(RemoteWebSocketTest, TestWebSocket) {
965 RunTest("testRemoteWebSocket", "about:blank");
966 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698