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

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

Issue 8571005: Add four new sync integration tests for custom search engines. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed remaining sync test issues. 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
« no previous file with comments | « chrome/browser/sync/test/integration/search_engines_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc b/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc
index 710eaf492b7f9ba6be0e37684f7789bcbfe0f411..5fb09f0cfc108575cc2055f2eab56488155d0d9b 100644
--- a/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc
@@ -54,6 +54,29 @@ IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, AddMultiple) {
ASSERT_TRUE(AllServicesMatch());
}
+// TCM ID - 9011135.
+IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, Duplicates) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(AllServicesMatch());
+
+ // Add two entries with the same Name and URL (but different keywords).
+ // Note that we have to change the GUID of the duplicate.
+ AddSearchEngine(0, 0);
+
+ TemplateURL* dupe = CreateTestTemplateURL(0);
+ dupe->set_keyword(ASCIIToUTF16("somethingelse"));
+ dupe->set_sync_guid("newguid");
+ GetServiceForProfile(0)->Add(dupe);
+
+ TemplateURL* verifier_dupe = CreateTestTemplateURL(0);
+ verifier_dupe->set_keyword(ASCIIToUTF16("somethingelse"));
+ verifier_dupe->set_sync_guid("newguid");
+ GetVerifierService()->Add(verifier_dupe);
+
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+ ASSERT_TRUE(AllServicesMatch());
+}
+
// TCM ID - 9004201.
IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, UpdateKeyword) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
@@ -65,7 +88,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, UpdateKeyword) {
ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
ASSERT_TRUE(AllServicesMatch());
- EditSearchEngine(0, "test0", "newkeyword", "test0", "http://www.test0.com/");
+ EditSearchEngine(0, "test0", "test0", "newkeyword", "http://www.test0.com/");
ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
ASSERT_TRUE(AllServicesMatch());
@@ -89,6 +112,23 @@ IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, UpdateUrl) {
ASSERT_TRUE(AllServicesMatch());
}
+// TCM ID - 8910490.
+IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, UpdateName) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(AllServicesMatch());
+
+ AddSearchEngine(0, 0);
+
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+ ASSERT_TRUE(AllServicesMatch());
+
+ // Change the short name.
+ EditSearchEngine(0, "test0", "New Name", "test0", "http://www.test0.com/");
+
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+ ASSERT_TRUE(AllServicesMatch());
+}
+
// TCM ID - 8898660.
IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, Delete) {
ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
@@ -105,6 +145,55 @@ IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, Delete) {
ASSERT_TRUE(AllServicesMatch());
}
+// TCM ID - 9004196.
+IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, ConflictKeyword) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ DisableVerifier();
+ ASSERT_TRUE(AllServicesMatch());
+
+ // Add a different search engine to each client, but make their keywords
+ // conflict.
+ AddSearchEngine(0, 0);
+ AddSearchEngine(1, 1);
+ const TemplateURL* turl = GetServiceForProfile(1)->
+ GetTemplateURLForKeyword(ASCIIToUTF16("test1"));
+ EXPECT_TRUE(turl);
+ GetServiceForProfile(1)->ResetTemplateURL(turl,
+ turl->short_name(),
+ ASCIIToUTF16("test0"),
+ turl->url()->url());
+
+ ASSERT_TRUE(AwaitQuiescence());
+ ASSERT_TRUE(AllServicesMatch());
+}
+
+// TCM ID - 9004187.
+IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, MergeMultiple) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ DisableVerifier();
+ ASSERT_TRUE(AllServicesMatch());
+
+ // Set up some different search engines on each client, with some interesting
+ // conflicts.
+ // client0: { SE0, SE1, SE2 }
+ for (int i = 0; i < 3; ++i) {
+ AddSearchEngine(0, i);
+ }
+
+ // client1: { SE0, SE2, SE3, SE0 + different URL }
+ AddSearchEngine(1, 0);
+ AddSearchEngine(1, 2);
+ AddSearchEngine(1, 3);
+ TemplateURL* turl = CreateTestTemplateURL(0);
+ turl->SetURL("http://www.somethingelse.com/", 0, 0);
+ turl->set_keyword(ASCIIToUTF16("somethingelse.com"));
+ turl->set_sync_guid("somethingelse");
+ GetServiceForProfile(1)->Add(turl);
+
+ ASSERT_TRUE(AwaitQuiescence());
+ ASSERT_TRUE(AllServicesMatch());
+}
+
// TCM ID - 8906436.
IN_PROC_BROWSER_TEST_F(TwoClientSearchEnginesSyncTest, DisableSync) {
ASSERT_TRUE(SetupSync());
« no previous file with comments | « chrome/browser/sync/test/integration/search_engines_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698