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