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

Side by Side Diff: chrome/browser/sync/test/integration/sync_test.cc

Issue 271693004: Change multi-client Sync tests to use FakeServer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/sync/test/integration/sync_test.h" 5 #include "chrome/browser/sync/test/integration/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/bind.h" 10 #include "base/bind.h"
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 if (server_type_ == SERVER_TYPE_UNDECIDED) { 587 if (server_type_ == SERVER_TYPE_UNDECIDED) {
588 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); 588 base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
589 if (!cl->HasSwitch(switches::kSyncServiceURL) && 589 if (!cl->HasSwitch(switches::kSyncServiceURL) &&
590 !cl->HasSwitch(switches::kSyncServerCommandLine)) { 590 !cl->HasSwitch(switches::kSyncServerCommandLine)) {
591 // If neither a sync server URL nor a sync server command line is 591 // If neither a sync server URL nor a sync server command line is
592 // provided, start up a local sync test server and point Chrome 592 // provided, start up a local sync test server and point Chrome
593 // to its URL. This is the most common configuration, and the only 593 // to its URL. This is the most common configuration, and the only
594 // one that makes sense for most developers. FakeServer is the 594 // one that makes sense for most developers. FakeServer is the
595 // current solution but some scenarios are only supported by the 595 // current solution but some scenarios are only supported by the
596 // legacy python server. 596 // legacy python server.
597 server_type_ = test_type_ == SINGLE_CLIENT || test_type_ == TWO_CLIENT ? 597 switch (test_type_) {
598 IN_PROCESS_FAKE_SERVER : LOCAL_PYTHON_SERVER; 598 case SINGLE_CLIENT:
599 case TWO_CLIENT:
600 case MULTIPLE_CLIENT:
601 server_type_ = IN_PROCESS_FAKE_SERVER;
602 break;
603 default:
604 server_type_ = LOCAL_PYTHON_SERVER;
605 }
599 } else if (cl->HasSwitch(switches::kSyncServiceURL) && 606 } else if (cl->HasSwitch(switches::kSyncServiceURL) &&
600 cl->HasSwitch(switches::kSyncServerCommandLine)) { 607 cl->HasSwitch(switches::kSyncServerCommandLine)) {
601 // If a sync server URL and a sync server command line are provided, 608 // If a sync server URL and a sync server command line are provided,
602 // start up a local sync server by running the command line. Chrome 609 // start up a local sync server by running the command line. Chrome
603 // will connect to the server at the URL that was provided. 610 // will connect to the server at the URL that was provided.
604 server_type_ = LOCAL_LIVE_SERVER; 611 server_type_ = LOCAL_LIVE_SERVER;
605 } else if (cl->HasSwitch(switches::kSyncServiceURL) && 612 } else if (cl->HasSwitch(switches::kSyncServiceURL) &&
606 !cl->HasSwitch(switches::kSyncServerCommandLine)) { 613 !cl->HasSwitch(switches::kSyncServerCommandLine)) {
607 // If a sync server URL is provided, but not a server command line, 614 // If a sync server URL is provided, but not a server command line,
608 // it is assumed that the server is already running. Chrome will 615 // it is assumed that the server is already running. Chrome will
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 BrowserThread::PostTask( 1034 BrowserThread::PostTask(
1028 BrowserThread::IO, FROM_HERE, 1035 BrowserThread::IO, FROM_HERE,
1029 base::Bind(&SetProxyConfigCallback, &done, 1036 base::Bind(&SetProxyConfigCallback, &done,
1030 make_scoped_refptr(context_getter), proxy_config)); 1037 make_scoped_refptr(context_getter), proxy_config));
1031 done.Wait(); 1038 done.Wait();
1032 } 1039 }
1033 1040
1034 fake_server::FakeServer* SyncTest::GetFakeServer() const { 1041 fake_server::FakeServer* SyncTest::GetFakeServer() const {
1035 return fake_server_.get(); 1042 return fake_server_.get();
1036 } 1043 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698