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

Unified Diff: chrome/test/automation/proxy_launcher.cc

Issue 7486007: Fix NamedProxyLauncher on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/automation/proxy_launcher.h ('k') | chrome/test/ui/named_interface_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automation/proxy_launcher.cc
diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc
index 2fb04c6c2595dbccb78e2b9cd64474fb6e9f3c89..b9144706392b811488c07c53ce802bac40248b45 100644
--- a/chrome/test/automation/proxy_launcher.cc
+++ b/chrome/test/automation/proxy_launcher.cc
@@ -25,6 +25,7 @@
#include "chrome/test/ui/ui_test.h"
#include "content/common/child_process_info.h"
#include "content/common/debug_flags.h"
+#include "ipc/ipc_channel.h"
#include "sql/connection.h"
namespace {
@@ -62,8 +63,12 @@ void UpdateHistoryDates(const FilePath& user_data_dir) {
// ProxyLauncher functions
-const char ProxyLauncher::kDefaultInterfacePath[] =
+#if defined(OS_WIN)
+const char ProxyLauncher::kDefaultInterfaceId[] = "ChromeTestingInterface";
+#elif defined(OS_POSIX)
+const char ProxyLauncher::kDefaultInterfaceId[] =
"/var/tmp/ChromeTestingInterface";
+#endif
bool ProxyLauncher::in_process_renderer_ = false;
bool ProxyLauncher::no_sandbox_ = false;
@@ -516,33 +521,28 @@ AutomationProxy* NamedProxyLauncher::CreateAutomationProxy(
void NamedProxyLauncher::InitializeConnection(const LaunchState& state,
bool wait_for_initial_loads) {
- FilePath testing_channel_path;
-#if defined(OS_WIN)
- testing_channel_path = FilePath(ASCIIToWide(channel_id_));
-#else
- testing_channel_path = FilePath(channel_id_);
-#endif
-
if (launch_browser_) {
+#if defined(OS_POSIX)
// Because we are waiting on the existence of the testing file below,
// make sure there isn't one already there before browser launch.
- EXPECT_TRUE(file_util::Delete(testing_channel_path, false));
+ EXPECT_TRUE(file_util::Delete(FilePath(channel_id_), false));
+#endif
// Set up IPC testing interface as a client.
ASSERT_TRUE(LaunchBrowser(state));
}
// Wait for browser to be ready for connections.
- bool testing_channel_exists = false;
+ bool channel_initialized = false;
for (int wait_time = 0;
wait_time < TestTimeouts::action_max_timeout_ms();
wait_time += automation::kSleepTime) {
- testing_channel_exists = file_util::PathExists(testing_channel_path);
- if (testing_channel_exists)
+ channel_initialized = IPC::Channel::IsNamedServerInitialized(channel_id_);
+ if (channel_initialized)
break;
base::PlatformThread::Sleep(automation::kSleepTime);
}
- EXPECT_TRUE(testing_channel_exists);
+ EXPECT_TRUE(channel_initialized);
ASSERT_TRUE(ConnectToRunningBrowser(wait_for_initial_loads));
}
« no previous file with comments | « chrome/test/automation/proxy_launcher.h ('k') | chrome/test/ui/named_interface_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698