| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 const int kAlternativeDebuggingPort = 9224; | 33 const int kAlternativeDebuggingPort = 9224; |
| 34 | 34 |
| 35 } | 35 } |
| 36 | 36 |
| 37 class PortForwardingTest: public InProcessBrowserTest { | 37 class PortForwardingTest: public InProcessBrowserTest { |
| 38 virtual int GetRemoteDebuggingPort() { | 38 virtual int GetRemoteDebuggingPort() { |
| 39 return kDefaultDebuggingPort; | 39 return kDefaultDebuggingPort; |
| 40 } | 40 } |
| 41 | 41 |
| 42 void SetUpCommandLine(base::CommandLine* command_line) override { | 42 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 43 InProcessBrowserTest::SetUpCommandLine(command_line); | |
| 44 command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, | 43 command_line->AppendSwitchASCII(switches::kRemoteDebuggingPort, |
| 45 base::IntToString(GetRemoteDebuggingPort())); | 44 base::IntToString(GetRemoteDebuggingPort())); |
| 46 } | 45 } |
| 47 | 46 |
| 48 protected: | 47 protected: |
| 49 class Listener : public DevToolsAndroidBridge::PortForwardingListener { | 48 class Listener : public DevToolsAndroidBridge::PortForwardingListener { |
| 50 public: | 49 public: |
| 51 explicit Listener(Profile* profile) | 50 explicit Listener(Profile* profile) |
| 52 : profile_(profile), | 51 : profile_(profile), |
| 53 skip_empty_devices_(true) { | 52 skip_empty_devices_(true) { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 base::RunLoop run_loop; | 180 base::RunLoop run_loop; |
| 182 | 181 |
| 183 self_provider->set_release_callback_for_test( | 182 self_provider->set_release_callback_for_test( |
| 184 base::Bind(base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask), | 183 base::Bind(base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask), |
| 185 base::ThreadTaskRunnerHandle::Get(), FROM_HERE, | 184 base::ThreadTaskRunnerHandle::Get(), FROM_HERE, |
| 186 run_loop.QuitWhenIdleClosure())); | 185 run_loop.QuitWhenIdleClosure())); |
| 187 wait_for_port_forwarding.reset(); | 186 wait_for_port_forwarding.reset(); |
| 188 | 187 |
| 189 content::RunThisRunLoop(&run_loop); | 188 content::RunThisRunLoop(&run_loop); |
| 190 } | 189 } |
| OLD | NEW |