| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/test/automation/proxy_launcher.h" | 5 #include "chrome/test/automation/proxy_launcher.h" |
| 6 | 6 |
| 7 #include "base/threading/platform_thread.h" |
| 7 #include "chrome/common/automation_constants.h" | 8 #include "chrome/common/automation_constants.h" |
| 8 #include "chrome/common/logging_chrome.h" | 9 #include "chrome/common/logging_chrome.h" |
| 9 #include "chrome/test/automation/automation_proxy.h" | 10 #include "chrome/test/automation/automation_proxy.h" |
| 10 #include "chrome/test/ui/ui_test.h" | 11 #include "chrome/test/ui/ui_test.h" |
| 11 | 12 |
| 12 // Default path of named testing interface. | 13 // Default path of named testing interface. |
| 13 static const char kInterfacePath[] = "/var/tmp/ChromeTestingInterface"; | 14 static const char kInterfacePath[] = "/var/tmp/ChromeTestingInterface"; |
| 14 | 15 |
| 15 // NamedProxyLauncher functions | 16 // NamedProxyLauncher functions |
| 16 | 17 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 30 } | 31 } |
| 31 | 32 |
| 32 void NamedProxyLauncher::InitializeConnection(UITestBase* ui_test_base) const { | 33 void NamedProxyLauncher::InitializeConnection(UITestBase* ui_test_base) const { |
| 33 if (launch_browser_) { | 34 if (launch_browser_) { |
| 34 // Set up IPC testing interface as a client. | 35 // Set up IPC testing interface as a client. |
| 35 ui_test_base->LaunchBrowser(); | 36 ui_test_base->LaunchBrowser(); |
| 36 | 37 |
| 37 // Wait for browser to be ready for connections. | 38 // Wait for browser to be ready for connections. |
| 38 struct stat file_info; | 39 struct stat file_info; |
| 39 while (stat(kInterfacePath, &file_info)) | 40 while (stat(kInterfacePath, &file_info)) |
| 40 PlatformThread::Sleep(automation::kSleepTime); | 41 base::PlatformThread::Sleep(automation::kSleepTime); |
| 41 } | 42 } |
| 42 | 43 |
| 43 ui_test_base->ConnectToRunningBrowser(); | 44 ui_test_base->ConnectToRunningBrowser(); |
| 44 } | 45 } |
| 45 | 46 |
| 46 std::string NamedProxyLauncher::PrefixedChannelID() const { | 47 std::string NamedProxyLauncher::PrefixedChannelID() const { |
| 47 std::string channel_id; | 48 std::string channel_id; |
| 48 channel_id.append(automation::kNamedInterfacePrefix).append(channel_id_); | 49 channel_id.append(automation::kNamedInterfacePrefix).append(channel_id_); |
| 49 return channel_id; | 50 return channel_id; |
| 50 } | 51 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 66 | 67 |
| 67 void AnonymousProxyLauncher::InitializeConnection( | 68 void AnonymousProxyLauncher::InitializeConnection( |
| 68 UITestBase* ui_test_base) const { | 69 UITestBase* ui_test_base) const { |
| 69 ui_test_base->LaunchBrowserAndServer(); | 70 ui_test_base->LaunchBrowserAndServer(); |
| 70 } | 71 } |
| 71 | 72 |
| 72 std::string AnonymousProxyLauncher::PrefixedChannelID() const { | 73 std::string AnonymousProxyLauncher::PrefixedChannelID() const { |
| 73 return channel_id_; | 74 return channel_id_; |
| 74 } | 75 } |
| 75 | 76 |
| OLD | NEW |