| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "chrome/browser/devtools/browser_list_tabcontents_provider.h" | 9 #include "chrome/browser/devtools/browser_list_tabcontents_provider.h" |
| 10 #include "chrome/browser/devtools/device/devtools_android_bridge.h" | 10 #include "chrome/browser/devtools/device/devtools_android_bridge.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 const int kDefaultDebuggingPort = 9223; | 27 const int kDefaultDebuggingPort = 9223; |
| 28 const int kAlternativeDebuggingPort = 9224; | 28 const int kAlternativeDebuggingPort = 9224; |
| 29 | 29 |
| 30 } | 30 } |
| 31 | 31 |
| 32 class PortForwardingTest: public InProcessBrowserTest { | 32 class PortForwardingTest: public InProcessBrowserTest { |
| 33 virtual int GetRemoteDebuggingPort() { | 33 virtual int GetRemoteDebuggingPort() { |
| 34 return kDefaultDebuggingPort; | 34 return kDefaultDebuggingPort; |
| 35 } | 35 } |
| 36 | 36 |
| 37 void SetUpCommandLine(CommandLine* command_line) override { | 37 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 38 InProcessBrowserTest::SetUpCommandLine(command_line); | 38 InProcessBrowserTest::SetUpCommandLine(command_line); |
| 39 command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, | 39 command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, |
| 40 base::IntToString(GetRemoteDebuggingPort())); | 40 base::IntToString(GetRemoteDebuggingPort())); |
| 41 } | 41 } |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 class Listener : public DevToolsAndroidBridge::PortForwardingListener { | 44 class Listener : public DevToolsAndroidBridge::PortForwardingListener { |
| 45 public: | 45 public: |
| 46 explicit Listener(Profile* profile) | 46 explicit Listener(Profile* profile) |
| 47 : profile_(profile), | 47 : profile_(profile), |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 content::RunMessageLoop(); | 171 content::RunMessageLoop(); |
| 172 | 172 |
| 173 self_provider->set_release_callback_for_test( | 173 self_provider->set_release_callback_for_test( |
| 174 base::Bind(&base::MessageLoop::PostTask, | 174 base::Bind(&base::MessageLoop::PostTask, |
| 175 base::Unretained(base::MessageLoop::current()), | 175 base::Unretained(base::MessageLoop::current()), |
| 176 FROM_HERE, | 176 FROM_HERE, |
| 177 base::MessageLoop::QuitClosure())); | 177 base::MessageLoop::QuitClosure())); |
| 178 wait_for_port_forwarding.reset(); | 178 wait_for_port_forwarding.reset(); |
| 179 content::RunMessageLoop(); | 179 content::RunMessageLoop(); |
| 180 } | 180 } |
| OLD | NEW |