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

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, 10 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 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 DevToolsAgentHost::GetOrCreateFor(web_contents).get(); 918 DevToolsAgentHost::GetOrCreateFor(web_contents).get();
919 const std::string agent_id = agent_raw->GetId(); 919 const std::string agent_id = agent_raw->GetId();
920 ASSERT_EQ(agent_raw, DevToolsAgentHost::GetForId(agent_id).get()) 920 ASSERT_EQ(agent_raw, DevToolsAgentHost::GetForId(agent_id).get())
921 << "DevToolsAgentHost cannot be found by id"; 921 << "DevToolsAgentHost cannot be found by id";
922 browser()->tab_strip_model()-> 922 browser()->tab_strip_model()->
923 CloseWebContentsAt(0, TabStripModel::CLOSE_NONE); 923 CloseWebContentsAt(0, TabStripModel::CLOSE_NONE);
924 ASSERT_FALSE(DevToolsAgentHost::GetForId(agent_id).get()) 924 ASSERT_FALSE(DevToolsAgentHost::GetForId(agent_id).get())
925 << "DevToolsAgentHost is not released when the tab is closed"; 925 << "DevToolsAgentHost is not released when the tab is closed";
926 } 926 }
927 927
928 class RemoteDebuggingTest: public ExtensionApiTest { 928 class RemoteDebuggingTest : public ExtensionApiTest {
929 void SetUpCommandLine(base::CommandLine* command_line) override { 929 void SetUpCommandLine(base::CommandLine* command_line) override {
930 ExtensionApiTest::SetUpCommandLine(command_line); 930 ExtensionApiTest::SetUpCommandLine(command_line);
931 command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, "9222"); 931 command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, "9222");
932 932
933 // Override the extension root path. 933 // Override the extension root path.
934 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); 934 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_);
935 test_data_dir_ = test_data_dir_.AppendASCII("devtools"); 935 test_data_dir_ = test_data_dir_.AppendASCII("devtools");
936 } 936 }
937 }; 937 };
938 938
939 // Fails on CrOS. crbug.com/431399 939 // Fails on CrOS. crbug.com/431399
940 #if defined(OS_CHROMEOS) 940 #if defined(OS_CHROMEOS)
941 #define MAYBE_RemoteDebugger DISABLED_RemoteDebugger 941 #define MAYBE_RemoteDebugger DISABLED_RemoteDebugger
942 #else 942 #else
943 #define MAYBE_RemoteDebugger RemoteDebugger 943 #define MAYBE_RemoteDebugger RemoteDebugger
944 #endif 944 #endif
945 IN_PROC_BROWSER_TEST_F(RemoteDebuggingTest, MAYBE_RemoteDebugger) { 945 IN_PROC_BROWSER_TEST_F(RemoteDebuggingTest, MAYBE_RemoteDebugger) {
946 #if defined(OS_WIN) && defined(USE_ASH) 946 #if defined(OS_WIN) && defined(USE_ASH)
947 // Disable this test in Metro+Ash for now (http://crbug.com/262796). 947 // Disable this test in Metro+Ash for now (http://crbug.com/262796).
948 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 948 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
949 switches::kAshBrowserTests)) 949 switches::kAshBrowserTests))
950 return; 950 return;
951 #endif 951 #endif
952 952
953 ASSERT_TRUE(RunExtensionTest("target_list")) << message_; 953 ASSERT_TRUE(RunExtensionTest("target_list")) << message_;
954 } 954 }
955
956 class RemoteWebSocketTest : public DevToolsSanityTest {
957 void SetUpCommandLine(base::CommandLine* command_line) override {
958 DevToolsSanityTest::SetUpCommandLine(command_line);
959 command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, "9222");
960 }
961 };
962
963 IN_PROC_BROWSER_TEST_F(RemoteWebSocketTest, WebSocketTest) {
964 RunTest("testRemoteWebSocket", "about:blank");
965 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698