Index: trunk/src/chrome/browser/sync/test/integration/sync_test.cc |
=================================================================== |
--- trunk/src/chrome/browser/sync/test/integration/sync_test.cc (revision 245340) |
+++ trunk/src/chrome/browser/sync/test/integration/sync_test.cc (working copy) |
@@ -60,8 +60,6 @@ |
#include "sync/engine/sync_scheduler_impl.h" |
#include "sync/notifier/p2p_invalidator.h" |
#include "sync/protocol/sync.pb.h" |
-#include "sync/test/fake_server/fake_server.h" |
-#include "sync/test/fake_server/fake_server_network_resources.h" |
#include "url/gurl.h" |
using content::BrowserThread; |
@@ -145,34 +143,30 @@ |
password_ = "password"; |
} |
- // Only set |server_type_| if it hasn't already been set. This allows for |
- // IN_PROCESS_FAKE_SERVER tests to set this value in each test class. |
- if (server_type_ == SERVER_TYPE_UNDECIDED) { |
- if (!cl->HasSwitch(switches::kSyncServiceURL) && |
- !cl->HasSwitch(switches::kSyncServerCommandLine)) { |
- // If neither a sync server URL nor a sync server command line is |
- // provided, start up a local python sync test server and point Chrome |
- // to its URL. This is the most common configuration, and the only |
- // one that makes sense for most developers. |
- server_type_ = LOCAL_PYTHON_SERVER; |
- } else if (cl->HasSwitch(switches::kSyncServiceURL) && |
- cl->HasSwitch(switches::kSyncServerCommandLine)) { |
- // If a sync server URL and a sync server command line are provided, |
- // start up a local sync server by running the command line. Chrome |
- // will connect to the server at the URL that was provided. |
- server_type_ = LOCAL_LIVE_SERVER; |
- } else if (cl->HasSwitch(switches::kSyncServiceURL) && |
- !cl->HasSwitch(switches::kSyncServerCommandLine)) { |
- // If a sync server URL is provided, but not a server command line, |
- // it is assumed that the server is already running. Chrome will |
- // automatically connect to it at the URL provided. There is nothing |
- // to do here. |
- server_type_ = EXTERNAL_LIVE_SERVER; |
- } else { |
- // If a sync server command line is provided, but not a server URL, |
- // we flag an error. |
- LOG(FATAL) << "Can't figure out how to run a server."; |
- } |
+ if (!cl->HasSwitch(switches::kSyncServiceURL) && |
+ !cl->HasSwitch(switches::kSyncServerCommandLine)) { |
+ // If neither a sync server URL nor a sync server command line is |
+ // provided, start up a local python sync test server and point Chrome |
+ // to its URL. This is the most common configuration, and the only |
+ // one that makes sense for most developers. |
+ server_type_ = LOCAL_PYTHON_SERVER; |
+ } else if (cl->HasSwitch(switches::kSyncServiceURL) && |
+ cl->HasSwitch(switches::kSyncServerCommandLine)) { |
+ // If a sync server URL and a sync server command line are provided, |
+ // start up a local sync server by running the command line. Chrome |
+ // will connect to the server at the URL that was provided. |
+ server_type_ = LOCAL_LIVE_SERVER; |
+ } else if (cl->HasSwitch(switches::kSyncServiceURL) && |
+ !cl->HasSwitch(switches::kSyncServerCommandLine)) { |
+ // If a sync server URL is provided, but not a server command line, |
+ // it is assumed that the server is already running. Chrome will |
+ // automatically connect to it at the URL provided. There is nothing |
+ // to do here. |
+ server_type_ = EXTERNAL_LIVE_SERVER; |
+ } else { |
+ // If a sync server command line is provided, but not a server URL, |
+ // we flag an error. |
+ LOG(FATAL) << "Can't figure out how to run a server."; |
} |
if (username_.empty() || password_.empty()) |
@@ -322,16 +316,8 @@ |
// Make sure the ProfileSyncService has been created before creating the |
// ProfileSyncServiceHarness - some tests expect the ProfileSyncService to |
// already exist. |
- ProfileSyncService* profile_sync_service = |
- ProfileSyncServiceFactory::GetForProfile(GetProfile(index)); |
+ ProfileSyncServiceFactory::GetForProfile(GetProfile(index)); |
- if (server_type_ == IN_PROCESS_FAKE_SERVER) { |
- // TODO(pvalenzuela): Run the fake server via EmbeddedTestServer. |
- profile_sync_service->OverrideNetworkResourcesForTest( |
- make_scoped_ptr<syncer::NetworkResources>( |
- new syncer::FakeServerNetworkResources(fake_server_.get()))); |
- } |
- |
clients_[index] = |
ProfileSyncServiceHarness::CreateForIntegrationTest( |
GetProfile(index), |
@@ -523,11 +509,6 @@ |
LOG(FATAL) << "Failed to set up local python XMPP server"; |
if (!SetUpLocalTestServer()) |
LOG(FATAL) << "Failed to set up local test server"; |
- } else if (server_type_ == IN_PROCESS_FAKE_SERVER) { |
- fake_server_.reset(new syncer::FakeServer()); |
- // Similar to LOCAL_LIVE_SERVER, we must start this for XMPP. |
- SetUpLocalPythonTestServer(); |
- SetupMockGaiaResponses(); |
} else if (server_type_ == EXTERNAL_LIVE_SERVER) { |
// Nothing to do; we'll just talk to the URL we were given. |
} else { |
@@ -881,8 +862,3 @@ |
make_scoped_refptr(context_getter), proxy_config)); |
done.Wait(); |
} |
- |
-void SyncTest::UseFakeServer() { |
- DCHECK_EQ(SERVER_TYPE_UNDECIDED, server_type_); |
- server_type_ = IN_PROCESS_FAKE_SERVER; |
-} |