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

Unified Diff: chrome/test/live_sync/live_sync_test.cc

Issue 7669073: [Sync] Add support for enabling session sync remotely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DOUBLE R..ebase Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/live_sync/live_sync_test.h ('k') | chrome/test/live_sync/migration_errors_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/live_sync/live_sync_test.cc
diff --git a/chrome/test/live_sync/live_sync_test.cc b/chrome/test/live_sync/live_sync_test.cc
index b3c319bf978a6f3253a771c96d57f8e8460ec975..ecb3f20ca1227d92c3a38b777bb4deab4c769ad3 100644
--- a/chrome/test/live_sync/live_sync_test.cc
+++ b/chrome/test/live_sync/live_sync_test.cc
@@ -151,14 +151,14 @@ void LiveSyncTest::SetUp() {
SetupMockGaiaResponses();
}
- 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) &&
+ 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
@@ -201,20 +201,27 @@ void LiveSyncTest::TearDown() {
}
void LiveSyncTest::SetUpCommandLine(CommandLine* cl) {
+ AddTestSwitches(cl);
+ AddOptionalTypesToCommandLine(cl);
+}
+
+void LiveSyncTest::AddTestSwitches(CommandLine* cl) {
// TODO(rsimha): Until we implement a fake Tango server against which tests
// can run, we need to set the --sync-notification-method to "p2p".
if (!cl->HasSwitch(switches::kSyncNotificationMethod))
cl->AppendSwitchASCII(switches::kSyncNotificationMethod, "p2p");
- // TODO(sync): Remove this once sessions sync is enabled by default.
- if (!cl->HasSwitch(switches::kEnableSyncSessions))
- cl->AppendSwitch(switches::kEnableSyncSessions);
-
// Disable non-essential access of external network resources.
if (!cl->HasSwitch(switches::kDisableBackgroundNetworking))
cl->AppendSwitch(switches::kDisableBackgroundNetworking);
}
+void LiveSyncTest::AddOptionalTypesToCommandLine(CommandLine* cl) {
+ // TODO(sync): Remove this once sessions sync is enabled by default.
+ if (!cl->HasSwitch(switches::kEnableSyncSessions))
+ cl->AppendSwitch(switches::kEnableSyncSessions);
+}
+
// static
Profile* LiveSyncTest::MakeProfile(const FilePath::StringType name) {
FilePath path;
@@ -357,7 +364,7 @@ void LiveSyncTest::ReadPasswordFile() {
std::vector<std::string> tokens;
std::string delimiters = "\r\n";
Tokenize(file_contents, delimiters, &tokens);
- ASSERT_TRUE(tokens.size() == 2) << "Password file \""
+ ASSERT_EQ(2U, tokens.size()) << "Password file \""
<< password_file_.value()
<< "\" must contain exactly two lines of text.";
username_ = tokens[0];
@@ -571,6 +578,14 @@ void LiveSyncTest::TriggerTransientError() {
UTF16ToASCII(browser()->GetSelectedTabContents()->GetTitle()));
}
+void LiveSyncTest::TriggerSetSyncTabs() {
+ ASSERT_TRUE(ServerSupportsErrorTriggering());
+ std::string path = "chromiumsync/synctabs";
+ ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path));
+ ASSERT_EQ("Sync Tabs",
+ UTF16ToASCII(browser()->GetSelectedTabContents()->GetTitle()));
+}
+
void LiveSyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter,
const net::ProxyConfig& proxy_config) {
base::WaitableEvent done(false, false);
« no previous file with comments | « chrome/test/live_sync/live_sync_test.h ('k') | chrome/test/live_sync/migration_errors_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698