| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/live_sync/live_sync_test.h" | 5 #include "chrome/test/live_sync/live_sync_test.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 cl->AppendSwitch(switches::kSyncAllowInsecureXmppConnection); | 394 cl->AppendSwitch(switches::kSyncAllowInsecureXmppConnection); |
| 395 } | 395 } |
| 396 | 396 |
| 397 return true; | 397 return true; |
| 398 } | 398 } |
| 399 | 399 |
| 400 bool LiveSyncTest::SetUpLocalTestServer() { | 400 bool LiveSyncTest::SetUpLocalTestServer() { |
| 401 CommandLine* cl = CommandLine::ForCurrentProcess(); | 401 CommandLine* cl = CommandLine::ForCurrentProcess(); |
| 402 CommandLine::StringType server_cmdline_string = cl->GetSwitchValueNative( | 402 CommandLine::StringType server_cmdline_string = cl->GetSwitchValueNative( |
| 403 switches::kSyncServerCommandLine); | 403 switches::kSyncServerCommandLine); |
| 404 #if defined(OS_WIN) | 404 CommandLine::StringVector server_cmdline_vector; |
| 405 CommandLine server_cmdline = CommandLine::FromString(server_cmdline_string); | 405 CommandLine::StringType delimiters(FILE_PATH_LITERAL(" ")); |
| 406 #else | |
| 407 std::vector<std::string> server_cmdline_vector; | |
| 408 std::string delimiters(" "); | |
| 409 Tokenize(server_cmdline_string, delimiters, &server_cmdline_vector); | 406 Tokenize(server_cmdline_string, delimiters, &server_cmdline_vector); |
| 410 CommandLine server_cmdline(server_cmdline_vector); | 407 CommandLine server_cmdline(server_cmdline_vector); |
| 411 #endif | |
| 412 if (!base::LaunchApp(server_cmdline, false, true, &test_server_handle_)) | 408 if (!base::LaunchApp(server_cmdline, false, true, &test_server_handle_)) |
| 413 LOG(ERROR) << "Could not launch local test server."; | 409 LOG(ERROR) << "Could not launch local test server."; |
| 414 | 410 |
| 415 const int kMaxWaitTime = TestTimeouts::live_operation_timeout_ms(); | 411 const int kMaxWaitTime = TestTimeouts::live_operation_timeout_ms(); |
| 416 const int kNumIntervals = 15; | 412 const int kNumIntervals = 15; |
| 417 if (WaitForTestServerToStart(kMaxWaitTime, kNumIntervals)) { | 413 if (WaitForTestServerToStart(kMaxWaitTime, kNumIntervals)) { |
| 418 VLOG(1) << "Started local test server at " | 414 VLOG(1) << "Started local test server at " |
| 419 << cl->GetSwitchValueASCII(switches::kSyncServiceURL) << "."; | 415 << cl->GetSwitchValueASCII(switches::kSyncServiceURL) << "."; |
| 420 return true; | 416 return true; |
| 421 } else { | 417 } else { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 const net::ProxyConfig& proxy_config) { | 509 const net::ProxyConfig& proxy_config) { |
| 514 base::WaitableEvent done(false, false); | 510 base::WaitableEvent done(false, false); |
| 515 BrowserThread::PostTask( | 511 BrowserThread::PostTask( |
| 516 BrowserThread::IO, | 512 BrowserThread::IO, |
| 517 FROM_HERE, | 513 FROM_HERE, |
| 518 new SetProxyConfigTask(&done, | 514 new SetProxyConfigTask(&done, |
| 519 context_getter, | 515 context_getter, |
| 520 proxy_config)); | 516 proxy_config)); |
| 521 done.Wait(); | 517 done.Wait(); |
| 522 } | 518 } |
| OLD | NEW |