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

Side by Side Diff: chrome/test/live_sync/live_sync_test.cc

Issue 6526040: CommandLine refactoring and cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Test Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 cl->AppendSwitch(switches::kSyncAllowInsecureXmppConnection); 374 cl->AppendSwitch(switches::kSyncAllowInsecureXmppConnection);
375 } 375 }
376 376
377 return true; 377 return true;
378 } 378 }
379 379
380 bool LiveSyncTest::SetUpLocalTestServer() { 380 bool LiveSyncTest::SetUpLocalTestServer() {
381 CommandLine* cl = CommandLine::ForCurrentProcess(); 381 CommandLine* cl = CommandLine::ForCurrentProcess();
382 CommandLine::StringType server_cmdline_string = cl->GetSwitchValueNative( 382 CommandLine::StringType server_cmdline_string = cl->GetSwitchValueNative(
383 switches::kSyncServerCommandLine); 383 switches::kSyncServerCommandLine);
384 #if defined(OS_WIN) 384 std::vector<CommandLine::StringType> server_cmdline_vector;
385 CommandLine server_cmdline = CommandLine::FromString(server_cmdline_string); 385 CommandLine::StringType delimiters(FILE_PATH_LITERAL(" "));
386 #else
387 std::vector<std::string> server_cmdline_vector;
388 std::string delimiters(" ");
389 Tokenize(server_cmdline_string, delimiters, &server_cmdline_vector); 386 Tokenize(server_cmdline_string, delimiters, &server_cmdline_vector);
390 CommandLine server_cmdline(server_cmdline_vector); 387 CommandLine server_cmdline(server_cmdline_vector);
391 #endif
392 if (!base::LaunchApp(server_cmdline, false, true, &test_server_handle_)) 388 if (!base::LaunchApp(server_cmdline, false, true, &test_server_handle_))
393 LOG(ERROR) << "Could not launch local test server."; 389 LOG(ERROR) << "Could not launch local test server.";
394 390
395 const int kMaxWaitTime = TestTimeouts::live_operation_timeout_ms(); 391 const int kMaxWaitTime = TestTimeouts::live_operation_timeout_ms();
396 const int kNumIntervals = 15; 392 const int kNumIntervals = 15;
397 if (WaitForTestServerToStart(kMaxWaitTime, kNumIntervals)) { 393 if (WaitForTestServerToStart(kMaxWaitTime, kNumIntervals)) {
398 VLOG(1) << "Started local test server at " 394 VLOG(1) << "Started local test server at "
399 << cl->GetSwitchValueASCII(switches::kSyncServiceURL) << "."; 395 << cl->GetSwitchValueASCII(switches::kSyncServiceURL) << ".";
400 return true; 396 return true;
401 } else { 397 } else {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 const net::ProxyConfig& proxy_config) { 466 const net::ProxyConfig& proxy_config) {
471 base::WaitableEvent done(false, false); 467 base::WaitableEvent done(false, false);
472 BrowserThread::PostTask( 468 BrowserThread::PostTask(
473 BrowserThread::IO, 469 BrowserThread::IO,
474 FROM_HERE, 470 FROM_HERE,
475 new SetProxyConfigTask(&done, 471 new SetProxyConfigTask(&done,
476 context_getter, 472 context_getter,
477 proxy_config)); 473 proxy_config));
478 done.Wait(); 474 done.Wait();
479 } 475 }
OLDNEW
« chrome/test/in_process_browser_test.cc ('K') | « chrome/test/in_process_browser_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698