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

Unified Diff: chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc

Issue 8334030: Merge search engines sync data type with Preferences. Sync the default search provider. Add some ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Merge to TOT and fixed additional conflicts from rsimha. Created 9 years, 1 month 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
Index: chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc
===================================================================
--- chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc (revision 109292)
+++ chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc (working copy)
@@ -11,8 +11,10 @@
using search_engines_helper::AddSearchEngine;
using search_engines_helper::AllServicesMatch;
+using search_engines_helper::ChangeDefaultSearchProvider;
using search_engines_helper::CreateTestTemplateURL;
-using search_engines_helper::DeleteSearchEngine;
+using search_engines_helper::DeleteSearchEngineByKeyword;
+using search_engines_helper::DeleteSearchEngineBySeed;
using search_engines_helper::EditSearchEngine;
using search_engines_helper::GetServiceForProfile;
using search_engines_helper::GetVerifierService;
@@ -97,7 +99,7 @@
ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
ASSERT_TRUE(AllServicesMatch());
- DeleteSearchEngine(0, "test0");
+ DeleteSearchEngineBySeed(0, 0);
ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
ASSERT_TRUE(AllServicesMatch());
@@ -119,3 +121,42 @@
ASSERT_TRUE(AwaitQuiescence());
ASSERT_TRUE(AllServicesMatch());
}
+
+// TCM ID - 8891809.
+IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, SyncDefault) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(AllServicesMatch());
+
+ AddSearchEngine(0, 0);
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+
+ // Change the default to the new search engine, sync, and ensure that it
+ // changed in the second client. AllServicesMatch does a default search
+ // provider check.
+ ChangeDefaultSearchProvider(0, 0);
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+
+ ASSERT_TRUE(AllServicesMatch());
+}
+
+// Ensure that we can change the search engine and immediately delete it
+// without putting the clients out of sync.
+IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, DeleteSyncedDefault) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(AllServicesMatch());
+
+ AddSearchEngine(0, 0);
+ AddSearchEngine(0, 1);
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+
+ ChangeDefaultSearchProvider(0, 0);
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+ ASSERT_TRUE(AllServicesMatch());
+
+ // Change the default on the first client and delete the old default.
+ ChangeDefaultSearchProvider(0, 1);
+ DeleteSearchEngineBySeed(0, 0);
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+
+ ASSERT_TRUE(AllServicesMatch());
+}

Powered by Google App Engine
This is Rietveld 408576698