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