| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/bookmarks/bookmark_utils.h" | 5 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 6 #include "chrome/test/live_sync/live_bookmarks_sync_test.h" | 6 #include "chrome/test/live_sync/live_bookmarks_sync_test.h" |
| 7 #include "base/rand_util.h" | 7 #include "base/rand_util.h" |
| 8 | 8 |
| 9 using std::string; | 9 using std::string; |
| 10 using std::wstring; | 10 using std::wstring; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 { | 126 { |
| 127 const BookmarkNode* google_one = GetByUniqueURL(bm0, initial_url); | 127 const BookmarkNode* google_one = GetByUniqueURL(bm0, initial_url); |
| 128 const BookmarkNode* google_two = GetByUniqueURL(bm1, initial_url); | 128 const BookmarkNode* google_two = GetByUniqueURL(bm1, initial_url); |
| 129 bookmark_utils::ApplyEditsWithNoGroupChange(bm0, bm_bar0, | 129 bookmark_utils::ApplyEditsWithNoGroupChange(bm0, bm_bar0, |
| 130 BookmarkEditor::EditDetails(google_one), title, second_url); | 130 BookmarkEditor::EditDetails(google_one), title, second_url); |
| 131 bookmark_utils::ApplyEditsWithNoGroupChange(bm1, bm_bar1, | 131 bookmark_utils::ApplyEditsWithNoGroupChange(bm1, bm_bar1, |
| 132 BookmarkEditor::EditDetails(google_two), title, third_url); | 132 BookmarkEditor::EditDetails(google_two), title, third_url); |
| 133 } | 133 } |
| 134 | 134 |
| 135 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 135 ASSERT_TRUE(ProfileSyncServiceTestHarness::AwaitQuiescence(clients())); |
| 136 // Make sure that client2 has pushed all of it's changes as well. | |
| 137 ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0))); | |
| 138 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); | 136 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
| 139 | 137 |
| 140 { | 138 { |
| 141 const BookmarkNode* google_one = bm_bar0->GetChild(0); | 139 const BookmarkNode* google_one = bm_bar0->GetChild(0); |
| 142 bm0->SetTitle(google_one, L"Google1"); | 140 bm0->SetTitle(google_one, L"Google1"); |
| 143 } | 141 } |
| 144 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 142 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 145 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); | 143 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
| 146 } | 144 } |
| 147 | 145 |
| 148 // Test Scribe ID - 370558. | 146 // Test Scribe ID - 370558. |
| 149 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 147 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 150 SC_AddFirstFolder) { | 148 SC_AddFirstFolder) { |
| 151 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 149 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 152 BookmarkModelVerifier* v = verifier_helper(); | 150 BookmarkModelVerifier* v = verifier_helper(); |
| 153 BookmarkModel* bm0 = GetBookmarkModel(0); | 151 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 154 BookmarkModel* bm1 = GetBookmarkModel(1); | 152 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 155 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 153 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 156 | 154 |
| 157 v->ExpectMatch(bm0); | 155 v->ExpectMatch(bm0); |
| 158 v->ExpectMatch(bm1); | 156 v->ExpectMatch(bm1); |
| 159 | 157 |
| 160 { | 158 { |
| 161 // Let's add first bookmark folder to client1 | 159 // Let's add first bookmark folder to client0 |
| 162 const BookmarkNode* new_folder_one = | 160 const BookmarkNode* new_folder_one = |
| 163 v->AddGroup(bm0, bm_bar0, 0, L"TestFolder"); | 161 v->AddGroup(bm0, bm_bar0, 0, L"TestFolder"); |
| 164 ASSERT_TRUE(new_folder_one != NULL); | 162 ASSERT_TRUE(new_folder_one != NULL); |
| 165 } | 163 } |
| 166 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 164 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 167 v->ExpectMatch(bm0); | 165 v->ExpectMatch(bm0); |
| 168 v->ExpectMatch(bm1); | 166 v->ExpectMatch(bm1); |
| 169 } | 167 } |
| 170 | 168 |
| 171 // Test Scribe ID - 370559. | 169 // Test Scribe ID - 370559. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 v->AddURL(bm0, bm_other0, index, title, GURL(url)); | 275 v->AddURL(bm0, bm_other0, index, title, GURL(url)); |
| 278 ASSERT_TRUE(nofavicon_bm != NULL); | 276 ASSERT_TRUE(nofavicon_bm != NULL); |
| 279 } | 277 } |
| 280 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 278 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 281 v->ExpectMatch(bm0); | 279 v->ExpectMatch(bm0); |
| 282 v->ExpectMatch(bm1); | 280 v->ExpectMatch(bm1); |
| 283 } | 281 } |
| 284 | 282 |
| 285 // Test Scribe ID - 370563. | 283 // Test Scribe ID - 370563. |
| 286 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 284 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 287 FAILS_SC_AddSeveralBMsAndFolders) { | 285 SC_AddSeveralBMsAndFolders) { |
| 288 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 286 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 289 BookmarkModelVerifier* v = verifier_helper(); | 287 BookmarkModelVerifier* v = verifier_helper(); |
| 290 BookmarkModel* bm0 = GetBookmarkModel(0); | 288 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 291 BookmarkModel* bm1 = GetBookmarkModel(1); | 289 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 292 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 290 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 293 const BookmarkNode* bm_other0 = bm0->other_node(); | 291 const BookmarkNode* bm_other0 = bm0->other_node(); |
| 294 | 292 |
| 295 v->ExpectMatch(bm0); | 293 v->ExpectMatch(bm0); |
| 296 v->ExpectMatch(bm1); | 294 v->ExpectMatch(bm1); |
| 297 // Let's add some GetBookmarkModel(without favicon) | 295 // Let's add some GetBookmarkModel(without favicon) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 L"Google", GURL("http://www.google.com/news")); | 365 L"Google", GURL("http://www.google.com/news")); |
| 368 ASSERT_TRUE(google_news_bm != NULL); | 366 ASSERT_TRUE(google_news_bm != NULL); |
| 369 } | 367 } |
| 370 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 368 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 371 v->ExpectMatch(bm0); | 369 v->ExpectMatch(bm0); |
| 372 v->ExpectMatch(bm1); | 370 v->ExpectMatch(bm1); |
| 373 } | 371 } |
| 374 | 372 |
| 375 // Test Scribe ID - 371817. | 373 // Test Scribe ID - 371817. |
| 376 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 374 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 377 FAILS_SC_RenameBMName) { | 375 SC_RenameBMName) { |
| 378 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 376 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 379 BookmarkModelVerifier* v = verifier_helper(); | 377 BookmarkModelVerifier* v = verifier_helper(); |
| 380 BookmarkModel* bm0 = GetBookmarkModel(0); | 378 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 381 BookmarkModel* bm1 = GetBookmarkModel(1); | 379 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 382 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 380 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 383 | 381 |
| 384 v->ExpectMatch(bm0); | 382 v->ExpectMatch(bm0); |
| 385 v->ExpectMatch(bm1); | 383 v->ExpectMatch(bm1); |
| 386 // Add first bookmark | 384 // Add first bookmark |
| 387 const BookmarkNode* test_bm1 = v->AddURL( | 385 const BookmarkNode* test_bm1 = v->AddURL( |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 | 477 |
| 480 // Let's rename newly added bookmark folder | 478 // Let's rename newly added bookmark folder |
| 481 v->SetTitle(bm0, bm_folder_one, L"New TestFolder"); | 479 v->SetTitle(bm0, bm_folder_one, L"New TestFolder"); |
| 482 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 480 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 483 v->ExpectMatch(bm0); | 481 v->ExpectMatch(bm0); |
| 484 v->ExpectMatch(bm1); | 482 v->ExpectMatch(bm1); |
| 485 } | 483 } |
| 486 | 484 |
| 487 // Test Scribe ID - 371826. | 485 // Test Scribe ID - 371826. |
| 488 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 486 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 489 FAILS_SC_RenameBMFolderWithLongHierarchy) { | 487 SC_RenameBMFolderWithLongHierarchy) { |
| 490 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 488 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 491 BookmarkModelVerifier* v = verifier_helper(); | 489 BookmarkModelVerifier* v = verifier_helper(); |
| 492 BookmarkModel* bm0 = GetBookmarkModel(0); | 490 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 493 BookmarkModel* bm1 = GetBookmarkModel(1); | 491 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 494 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 492 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 495 | 493 |
| 496 v->ExpectMatch(bm0); | 494 v->ExpectMatch(bm0); |
| 497 v->ExpectMatch(bm1); | 495 v->ExpectMatch(bm1); |
| 498 | 496 |
| 499 // Let's add first bookmark folder to under bookmark_bar. | 497 // Let's add first bookmark folder to under bookmark_bar. |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 v->Remove(bm0, bm_folder_one, 4); | 815 v->Remove(bm0, bm_folder_one, 4); |
| 818 } | 816 } |
| 819 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 817 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 820 v->ExpectMatch(bm0); | 818 v->ExpectMatch(bm0); |
| 821 v->ExpectMatch(bm1); | 819 v->ExpectMatch(bm1); |
| 822 } | 820 } |
| 823 | 821 |
| 824 | 822 |
| 825 // Test Scribe ID - 371857. | 823 // Test Scribe ID - 371857. |
| 826 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 824 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 827 FAILS_SC_DelBMsUnderBMFoldEmptyFolderAfterwards) { | 825 SC_DelBMsUnderBMFoldEmptyFolderAfterwards) { |
| 828 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 826 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 829 BookmarkModelVerifier* v = verifier_helper(); | 827 BookmarkModelVerifier* v = verifier_helper(); |
| 830 BookmarkModel* bm0 = GetBookmarkModel(0); | 828 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 831 BookmarkModel* bm1 = GetBookmarkModel(1); | 829 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 832 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 830 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 833 | 831 |
| 834 v->ExpectMatch(bm0); | 832 v->ExpectMatch(bm0); |
| 835 v->ExpectMatch(bm1); | 833 v->ExpectMatch(bm1); |
| 836 // Let's add first bookmark folder to client1 | 834 // Let's add first bookmark folder to client1 |
| 837 const BookmarkNode* bm_folder_one = | 835 const BookmarkNode* bm_folder_one = |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 | 933 |
| 936 // Let's delete the first empty bookmark folder | 934 // Let's delete the first empty bookmark folder |
| 937 v->Remove(bm0, bm_bar0, 0); | 935 v->Remove(bm0, bm_bar0, 0); |
| 938 | 936 |
| 939 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 937 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 940 v->ExpectMatch(bm0); | 938 v->ExpectMatch(bm0); |
| 941 v->ExpectMatch(bm1); | 939 v->ExpectMatch(bm1); |
| 942 } | 940 } |
| 943 | 941 |
| 944 // Test Scribe ID - 371879. | 942 // Test Scribe ID - 371879. |
| 943 // TODO(rsimha): This currently fails due to http://crbug.com/50306. |
| 945 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 944 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 946 FAILS_SC_DelBMFoldWithBMsNonEmptyAccountAfterwards) { | 945 FAILS_SC_DelBMFoldWithBMsNonEmptyAccountAfterwards) { |
| 947 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 946 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 948 BookmarkModelVerifier* v = verifier_helper(); | 947 BookmarkModelVerifier* v = verifier_helper(); |
| 949 BookmarkModel* bm0 = GetBookmarkModel(0); | 948 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 950 BookmarkModel* bm1 = GetBookmarkModel(1); | 949 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 951 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 950 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 952 ASSERT_TRUE(bm_bar0 != NULL); | 951 ASSERT_TRUE(bm_bar0 != NULL); |
| 953 const BookmarkNode* bm_other0 = bm0->other_node(); | 952 const BookmarkNode* bm_other0 = bm0->other_node(); |
| 954 ASSERT_TRUE(bm_other0 != NULL); | 953 ASSERT_TRUE(bm_other0 != NULL); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 wstring title(L"Level2 - TestBookmark"); | 989 wstring title(L"Level2 - TestBookmark"); |
| 991 title.append(IntToWString(index)); | 990 title.append(IntToWString(index)); |
| 992 string url("http://www.nofaviconurl"); | 991 string url("http://www.nofaviconurl"); |
| 993 url.append(IntToString(index)); | 992 url.append(IntToString(index)); |
| 994 url.append(".com"); | 993 url.append(".com"); |
| 995 const BookmarkNode* nofavicon_bm = v->AddURL(bm0, | 994 const BookmarkNode* nofavicon_bm = v->AddURL(bm0, |
| 996 bm_folder_one, index, title, GURL(url)); | 995 bm_folder_one, index, title, GURL(url)); |
| 997 ASSERT_TRUE(nofavicon_bm != NULL); | 996 ASSERT_TRUE(nofavicon_bm != NULL); |
| 998 } | 997 } |
| 999 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 998 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1000 v->ExpectMatch(bm0); | 999 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
| 1001 v->ExpectMatch(bm1); | |
| 1002 | 1000 |
| 1003 // Let's delete the bookmark folder (bm_folder_one) | 1001 // Let's delete the bookmark folder (bm_folder_one) |
| 1004 v->Remove(bm0, bm_bar0, 1); | 1002 v->Remove(bm0, bm_bar0, 1); |
| 1005 | 1003 |
| 1006 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1004 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1007 v->ExpectMatch(bm0); | 1005 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
| 1008 v->ExpectMatch(bm1); | |
| 1009 } | 1006 } |
| 1010 | 1007 |
| 1011 | |
| 1012 // Test Scribe ID - 371880. | 1008 // Test Scribe ID - 371880. |
| 1009 // TODO(rsimha): This currently fails due to http://crbug.com/50306. |
| 1013 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1010 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1014 FAILS_SC_DelBMFoldWithBMsAndBMFoldsNonEmptyACAfterwards) { | 1011 FAILS_SC_DelBMFoldWithBMsAndBMFoldsNonEmptyACAfterwards) { |
| 1015 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1012 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1016 BookmarkModelVerifier* v = verifier_helper(); | 1013 BookmarkModelVerifier* v = verifier_helper(); |
| 1017 BookmarkModel* bm0 = GetBookmarkModel(0); | 1014 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1018 BookmarkModel* bm1 = GetBookmarkModel(1); | 1015 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1019 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1016 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 1020 const BookmarkNode* bm_other0 = bm0->other_node(); | 1017 const BookmarkNode* bm_other0 = bm0->other_node(); |
| 1021 ASSERT_TRUE(bm_other0 != NULL); | 1018 ASSERT_TRUE(bm_other0 != NULL); |
| 1022 | 1019 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 title.append(IntToWString(index)); | 1091 title.append(IntToWString(index)); |
| 1095 const BookmarkNode* l3_bm_folder = | 1092 const BookmarkNode* l3_bm_folder = |
| 1096 v->AddGroup(bm0, l2_bm_folder, index2, title); | 1093 v->AddGroup(bm0, l2_bm_folder, index2, title); |
| 1097 ASSERT_TRUE(l3_bm_folder != NULL); | 1094 ASSERT_TRUE(l3_bm_folder != NULL); |
| 1098 } | 1095 } |
| 1099 } // end inner for loop | 1096 } // end inner for loop |
| 1100 } | 1097 } |
| 1101 } | 1098 } |
| 1102 } | 1099 } |
| 1103 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1100 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1104 v->ExpectMatch(bm0); | 1101 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
| 1105 v->ExpectMatch(bm1); | |
| 1106 | 1102 |
| 1107 // Let's delete the bookmark folder (bm_folder_one) | 1103 // Let's delete the bookmark folder (bm_folder_one) |
| 1108 v->Remove(bm0, bm_bar0, 1); | 1104 v->Remove(bm0, bm_bar0, 1); |
| 1109 | 1105 |
| 1110 | |
| 1111 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1106 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1112 v->ExpectMatch(bm0); | 1107 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
| 1113 v->ExpectMatch(bm1); | |
| 1114 } | 1108 } |
| 1115 | 1109 |
| 1116 // Test Scribe ID - 371882. | 1110 // Test Scribe ID - 371882. |
| 1111 // TODO(rsimha): This currently fails due to http://crbug.com/50306. |
| 1117 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1112 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1118 FAILS_SC_DelBMFoldWithParentAndChildrenBMsAndBMFolds) { | 1113 FAILS_SC_DelBMFoldWithParentAndChildrenBMsAndBMFolds) { |
| 1119 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1114 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1120 BookmarkModelVerifier* v = verifier_helper(); | 1115 BookmarkModelVerifier* v = verifier_helper(); |
| 1121 BookmarkModel* bm0 = GetBookmarkModel(0); | 1116 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1122 BookmarkModel* bm1 = GetBookmarkModel(1); | 1117 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1123 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1118 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 1124 | 1119 |
| 1125 v->ExpectMatch(bm0); | 1120 v->ExpectMatch(bm0); |
| 1126 v->ExpectMatch(bm1); | 1121 v->ExpectMatch(bm1); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 // Remaining % of time - Add Bookmark folders | 1157 // Remaining % of time - Add Bookmark folders |
| 1163 wstring title(L"Test BMFolder - ChildTestBMFolder"); | 1158 wstring title(L"Test BMFolder - ChildTestBMFolder"); |
| 1164 title.append(IntToWString(index)); | 1159 title.append(IntToWString(index)); |
| 1165 const BookmarkNode* bm_folder = | 1160 const BookmarkNode* bm_folder = |
| 1166 v->AddGroup(bm0, test_bm_folder, index, title); | 1161 v->AddGroup(bm0, test_bm_folder, index, title); |
| 1167 ASSERT_TRUE(bm_folder != NULL); | 1162 ASSERT_TRUE(bm_folder != NULL); |
| 1168 } | 1163 } |
| 1169 } | 1164 } |
| 1170 | 1165 |
| 1171 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1166 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1172 v->ExpectMatch(bm0); | 1167 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
| 1173 v->ExpectMatch(bm1); | |
| 1174 | 1168 |
| 1175 // Let's delete test_bm_folder | 1169 // Let's delete test_bm_folder |
| 1176 v->Remove(bm0, parent_bm_folder, 0); | 1170 v->Remove(bm0, parent_bm_folder, 0); |
| 1171 |
| 1177 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1172 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1178 v->ExpectMatch(bm0); | 1173 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
| 1179 v->ExpectMatch(bm1); | |
| 1180 } | 1174 } |
| 1181 | 1175 |
| 1182 | |
| 1183 // Test Scribe ID - 371931. | 1176 // Test Scribe ID - 371931. |
| 1184 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1177 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1185 SC_ReverseTheOrderOfTwoBMs) { | 1178 SC_ReverseTheOrderOfTwoBMs) { |
| 1186 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1179 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1187 BookmarkModelVerifier* v = verifier_helper(); | 1180 BookmarkModelVerifier* v = verifier_helper(); |
| 1188 BookmarkModel* bm0 = GetBookmarkModel(0); | 1181 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1189 BookmarkModel* bm1 = GetBookmarkModel(1); | 1182 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1190 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1183 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 1191 v->ExpectMatch(bm0); | 1184 v->ExpectMatch(bm0); |
| 1192 v->ExpectMatch(bm1); | 1185 v->ExpectMatch(bm1); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 v->Move(bm0, bm_bar0->GetChild(2), | 1281 v->Move(bm0, bm_bar0->GetChild(2), |
| 1289 bm_folder_one, index); | 1282 bm_folder_one, index); |
| 1290 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1283 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1291 v->ExpectMatch(bm0); | 1284 v->ExpectMatch(bm0); |
| 1292 v->ExpectMatch(bm1); | 1285 v->ExpectMatch(bm1); |
| 1293 } | 1286 } |
| 1294 } | 1287 } |
| 1295 | 1288 |
| 1296 // Test Scribe ID - 371957. | 1289 // Test Scribe ID - 371957. |
| 1297 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1290 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1298 FAILS_SC_MovingBMsFromBMFoldToBMBar) { | 1291 SC_MovingBMsFromBMFoldToBMBar) { |
| 1299 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1292 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1300 BookmarkModelVerifier* v = verifier_helper(); | 1293 BookmarkModelVerifier* v = verifier_helper(); |
| 1301 BookmarkModel* bm0 = GetBookmarkModel(0); | 1294 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1302 BookmarkModel* bm1 = GetBookmarkModel(1); | 1295 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1303 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1296 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 1304 const BookmarkNode* bm_other0 = bm0->other_node(); | 1297 const BookmarkNode* bm_other0 = bm0->other_node(); |
| 1305 ASSERT_TRUE(bm_other0 != NULL); | 1298 ASSERT_TRUE(bm_other0 != NULL); |
| 1306 | 1299 |
| 1307 v->ExpectMatch(bm0); | 1300 v->ExpectMatch(bm0); |
| 1308 v->ExpectMatch(bm1); | 1301 v->ExpectMatch(bm1); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1454 v->Move(bm0, bm_h, parent_folder, 0); | 1447 v->Move(bm0, bm_h, parent_folder, 0); |
| 1455 | 1448 |
| 1456 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1449 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1457 v->ExpectMatch(bm0); | 1450 v->ExpectMatch(bm0); |
| 1458 v->ExpectMatch(bm1); | 1451 v->ExpectMatch(bm1); |
| 1459 } | 1452 } |
| 1460 | 1453 |
| 1461 | 1454 |
| 1462 // Test Scribe ID - 371967. | 1455 // Test Scribe ID - 371967. |
| 1463 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1456 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1464 FAILS_SC_HoistBMs10LevelUp) { | 1457 SC_HoistBMs10LevelUp) { |
| 1465 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1458 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1466 BookmarkModelVerifier* v = verifier_helper(); | 1459 BookmarkModelVerifier* v = verifier_helper(); |
| 1467 BookmarkModel* bm0 = GetBookmarkModel(0); | 1460 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1468 BookmarkModel* bm1 = GetBookmarkModel(1); | 1461 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1469 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1462 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 1470 | 1463 |
| 1471 v->ExpectMatch(bm0); | 1464 v->ExpectMatch(bm0); |
| 1472 v->ExpectMatch(bm1); | 1465 v->ExpectMatch(bm1); |
| 1473 const BookmarkNode* bm_folder = bm_bar0; | 1466 const BookmarkNode* bm_folder = bm_bar0; |
| 1474 const BookmarkNode* bm_folder_L10 = NULL; | 1467 const BookmarkNode* bm_folder_L10 = NULL; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1593 v->Move(bm0, bm_c, bm_folder_L10, 1); | 1586 v->Move(bm0, bm_c, bm_folder_L10, 1); |
| 1594 | 1587 |
| 1595 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1588 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1596 v->ExpectMatch(bm0); | 1589 v->ExpectMatch(bm0); |
| 1597 v->ExpectMatch(bm1); | 1590 v->ExpectMatch(bm1); |
| 1598 } | 1591 } |
| 1599 | 1592 |
| 1600 | 1593 |
| 1601 // Test Scribe ID - 371980. | 1594 // Test Scribe ID - 371980. |
| 1602 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1595 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1603 FAILS_SC_SinkEmptyBMFold5LevelsDown) { | 1596 SC_SinkEmptyBMFold5LevelsDown) { |
| 1604 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1597 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1605 BookmarkModelVerifier* v = verifier_helper(); | 1598 BookmarkModelVerifier* v = verifier_helper(); |
| 1606 BookmarkModel* bm0 = GetBookmarkModel(0); | 1599 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1607 BookmarkModel* bm1 = GetBookmarkModel(1); | 1600 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1608 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1601 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 1609 | 1602 |
| 1610 v->ExpectMatch(bm0); | 1603 v->ExpectMatch(bm0); |
| 1611 v->ExpectMatch(bm1); | 1604 v->ExpectMatch(bm1); |
| 1612 | 1605 |
| 1613 const BookmarkNode* bm_folder = bm_bar0; | 1606 const BookmarkNode* bm_folder = bm_bar0; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1648 v->Move(bm0, empty_bm_folder, bm_folder_L5, | 1641 v->Move(bm0, empty_bm_folder, bm_folder_L5, |
| 1649 bm_folder_L5->GetChildCount()); | 1642 bm_folder_L5->GetChildCount()); |
| 1650 | 1643 |
| 1651 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1644 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1652 v->ExpectMatch(bm0); | 1645 v->ExpectMatch(bm0); |
| 1653 v->ExpectMatch(bm1); | 1646 v->ExpectMatch(bm1); |
| 1654 } | 1647 } |
| 1655 | 1648 |
| 1656 // Test Scribe ID - 371997. | 1649 // Test Scribe ID - 371997. |
| 1657 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1650 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1658 FAILS_SC_SinkNonEmptyBMFold5LevelsDown) { | 1651 SC_SinkNonEmptyBMFold5LevelsDown) { |
| 1659 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1652 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1660 BookmarkModelVerifier* v = verifier_helper(); | 1653 BookmarkModelVerifier* v = verifier_helper(); |
| 1661 BookmarkModel* bm0 = GetBookmarkModel(0); | 1654 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1662 BookmarkModel* bm1 = GetBookmarkModel(1); | 1655 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1663 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1656 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 1664 | 1657 |
| 1665 v->ExpectMatch(bm0); | 1658 v->ExpectMatch(bm0); |
| 1666 v->ExpectMatch(bm1); | 1659 v->ExpectMatch(bm1); |
| 1667 | 1660 |
| 1668 const BookmarkNode* bm_folder = bm_bar0; | 1661 const BookmarkNode* bm_folder = bm_bar0; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1814 // Let's change positions of bookmark folders so it is more like ba. | 1807 // Let's change positions of bookmark folders so it is more like ba. |
| 1815 v->ReverseChildOrder(bm0, bm_bar0); | 1808 v->ReverseChildOrder(bm0, bm_bar0); |
| 1816 | 1809 |
| 1817 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1810 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1818 v->ExpectMatch(bm0); | 1811 v->ExpectMatch(bm0); |
| 1819 v->ExpectMatch(bm1); | 1812 v->ExpectMatch(bm1); |
| 1820 } | 1813 } |
| 1821 | 1814 |
| 1822 // Test Scribe ID - 372028. | 1815 // Test Scribe ID - 372028. |
| 1823 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1816 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1824 FAILS_SC_ReverseTheOrderOfTenBMFolders) { | 1817 SC_ReverseTheOrderOfTenBMFolders) { |
| 1825 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1818 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1826 BookmarkModelVerifier* v = verifier_helper(); | 1819 BookmarkModelVerifier* v = verifier_helper(); |
| 1827 BookmarkModel* bm0 = GetBookmarkModel(0); | 1820 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1828 BookmarkModel* bm1 = GetBookmarkModel(1); | 1821 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1829 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1822 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 1830 v->ExpectMatch(bm0); | 1823 v->ExpectMatch(bm0); |
| 1831 v->ExpectMatch(bm1); | 1824 v->ExpectMatch(bm1); |
| 1832 | 1825 |
| 1833 // Let's add 10 non-empty bookmark folders like 0123456789 | 1826 // Let's add 10 non-empty bookmark folders like 0123456789 |
| 1834 for (int index = 0; index < 10; index++) { | 1827 for (int index = 0; index < 10; index++) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1872 ASSERT_TRUE(bm_foo3 != NULL); | 1865 ASSERT_TRUE(bm_foo3 != NULL); |
| 1873 | 1866 |
| 1874 const BookmarkNode* bm_foo2 = bm0->AddURL( | 1867 const BookmarkNode* bm_foo2 = bm0->AddURL( |
| 1875 bm_bar0, 1, L"Foo2", GURL("http://www.foo2.com")); | 1868 bm_bar0, 1, L"Foo2", GURL("http://www.foo2.com")); |
| 1876 ASSERT_TRUE(bm_foo2 != NULL); | 1869 ASSERT_TRUE(bm_foo2 != NULL); |
| 1877 const BookmarkNode* bm_foo4 = bm1->AddURL( | 1870 const BookmarkNode* bm_foo4 = bm1->AddURL( |
| 1878 bm_bar1, 1, L"Foo4", GURL("http://www.foo4.com")); | 1871 bm_bar1, 1, L"Foo4", GURL("http://www.foo4.com")); |
| 1879 ASSERT_TRUE(bm_foo4 != NULL); | 1872 ASSERT_TRUE(bm_foo4 != NULL); |
| 1880 } | 1873 } |
| 1881 | 1874 |
| 1882 | 1875 ASSERT_TRUE(ProfileSyncServiceTestHarness::AwaitQuiescence(clients())); |
| 1883 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | |
| 1884 // Make sure that client2 has pushed all of it's changes as well. | |
| 1885 ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0))); | |
| 1886 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); | 1876 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
| 1887 } | 1877 } |
| 1888 | 1878 |
| 1889 // Test Scribe ID - 373506. | 1879 // Test Scribe ID - 373506. |
| 1890 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1880 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1891 FAILS_MC_BootStrapEmptyStateEverywhere) { | 1881 MC_BootStrapEmptyStateEverywhere) { |
| 1892 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1882 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1893 BookmarkModelVerifier* v = verifier_helper(); | 1883 BookmarkModelVerifier* v = verifier_helper(); |
| 1894 BookmarkModel* bm0 = GetBookmarkModel(0); | 1884 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1895 BookmarkModel* bm1 = GetBookmarkModel(1); | 1885 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1896 | 1886 ASSERT_TRUE(ProfileSyncServiceTestHarness::AwaitQuiescence(clients())); |
| 1897 // Wait for changes to propagate. | |
| 1898 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | |
| 1899 // Let's compare and make sure both bookmark models are same after sync. | |
| 1900 v->ExpectMatch(bm0); | 1887 v->ExpectMatch(bm0); |
| 1901 v->ExpectMatch(bm1); | 1888 v->ExpectMatch(bm1); |
| 1902 } | 1889 } |
| 1903 | 1890 |
| 1904 // Test Scribe ID - 373508. | 1891 // Test Scribe ID - 373508. |
| 1905 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1892 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1906 FAILS_MC_SimpleMergeOfDifferentBMModels) { | 1893 MC_SimpleMergeOfDifferentBMModels) { |
| 1907 ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; | 1894 ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; |
| 1908 BookmarkModel* bm0 = GetBookmarkModel(0); | 1895 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1909 BookmarkModel* bm1 = GetBookmarkModel(1); | 1896 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1910 | 1897 |
| 1911 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1898 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 1912 const BookmarkNode* bm_bar1 = bm1->GetBookmarkBarNode(); | 1899 const BookmarkNode* bm_bar1 = bm1->GetBookmarkBarNode(); |
| 1913 | 1900 |
| 1914 // Let's add same bookmarks (without favicon) to both clients. | 1901 // Let's add same bookmarks (without favicon) to both clients. |
| 1915 for (int index = 0; index < 3; index++) { | 1902 for (int index = 0; index < 3; index++) { |
| 1916 wstring title(L"TestBookmark"); | 1903 wstring title(L"TestBookmark"); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1947 url.append(".com"); | 1934 url.append(".com"); |
| 1948 const BookmarkNode* nofavicon_bm_client1 = | 1935 const BookmarkNode* nofavicon_bm_client1 = |
| 1949 bm1->AddURL(bm_bar1, index, title, GURL(url)); | 1936 bm1->AddURL(bm_bar1, index, title, GURL(url)); |
| 1950 ASSERT_TRUE(nofavicon_bm_client1 != NULL); | 1937 ASSERT_TRUE(nofavicon_bm_client1 != NULL); |
| 1951 } | 1938 } |
| 1952 | 1939 |
| 1953 // Set up sync on both clients. | 1940 // Set up sync on both clients. |
| 1954 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1941 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1955 | 1942 |
| 1956 // Wait for changes to propagate. | 1943 // Wait for changes to propagate. |
| 1957 ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0))); | 1944 ASSERT_TRUE(ProfileSyncServiceTestHarness::AwaitQuiescence(clients())); |
| 1958 // Let's make sure there aren't any duplicates after sync. | 1945 // Let's make sure there aren't any duplicates after sync. |
| 1959 BookmarkModelVerifier::VerifyNoDuplicates(bm0); | 1946 BookmarkModelVerifier::VerifyNoDuplicates(bm0); |
| 1960 // Let's compare and make sure both bookmark models are same after sync. | 1947 // Let's compare and make sure both bookmark models are same after sync. |
| 1961 BookmarkModelVerifier::ExpectModelsMatchIncludingFavicon( | 1948 BookmarkModelVerifier::ExpectModelsMatchIncludingFavicon( |
| 1962 bm0, bm1, false); | 1949 bm0, bm1, false); |
| 1963 } | 1950 } |
| 1964 | 1951 |
| 1965 // Test Scribe ID - 386586. | 1952 // Test Scribe ID - 386586. |
| 1966 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1953 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1967 FAILS_MC_MergeSimpleBMHierarchyUnderBMBar) { | 1954 MC_MergeSimpleBMHierarchyUnderBMBar) { |
| 1968 ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; | 1955 ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; |
| 1969 BookmarkModel* bm0 = GetBookmarkModel(0); | 1956 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1970 BookmarkModel* bm1 = GetBookmarkModel(1); | 1957 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1971 ui_test_utils::WaitForBookmarkModelToLoad(bm1); | 1958 ui_test_utils::WaitForBookmarkModelToLoad(bm1); |
| 1972 | 1959 |
| 1973 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1960 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 1974 const BookmarkNode* bm_bar1 = bm1->GetBookmarkBarNode(); | 1961 const BookmarkNode* bm_bar1 = bm1->GetBookmarkBarNode(); |
| 1975 | 1962 |
| 1976 // Let's add same bookmarks (without favicon) to both clients. | 1963 // Let's add same bookmarks (without favicon) to both clients. |
| 1977 for (int index = 0; index < 3 ; index++) { | 1964 for (int index = 0; index < 3 ; index++) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1997 url.append(".com"); | 1984 url.append(".com"); |
| 1998 const BookmarkNode* nofavicon_bm_client1 = | 1985 const BookmarkNode* nofavicon_bm_client1 = |
| 1999 bm1->AddURL(bm_bar1, index, title, GURL(url)); | 1986 bm1->AddURL(bm_bar1, index, title, GURL(url)); |
| 2000 ASSERT_TRUE(nofavicon_bm_client1 != NULL); | 1987 ASSERT_TRUE(nofavicon_bm_client1 != NULL); |
| 2001 } | 1988 } |
| 2002 | 1989 |
| 2003 // Set up sync on both clients. | 1990 // Set up sync on both clients. |
| 2004 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1991 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 2005 | 1992 |
| 2006 // Wait for changes to propagate. | 1993 // Wait for changes to propagate. |
| 2007 ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0))); | 1994 ASSERT_TRUE(ProfileSyncServiceTestHarness::AwaitQuiescence(clients())); |
| 2008 // Let's make sure there aren't any duplicates after sync. | 1995 // Let's make sure there aren't any duplicates after sync. |
| 2009 BookmarkModelVerifier::VerifyNoDuplicates(bm0); | 1996 BookmarkModelVerifier::VerifyNoDuplicates(bm0); |
| 2010 // Let's compare and make sure both bookmark models are same after sync. | 1997 // Let's compare and make sure both bookmark models are same after sync. |
| 2011 BookmarkModelVerifier::ExpectModelsMatchIncludingFavicon( | 1998 BookmarkModelVerifier::ExpectModelsMatchIncludingFavicon( |
| 2012 bm0, bm1, false); | 1999 bm0, bm1, false); |
| 2013 } | 2000 } |
| 2014 | 2001 |
| 2015 // Test Scribe ID - 386589. | 2002 // Test Scribe ID - 386589. |
| 2016 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 2003 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 2017 FAILS_MC_MergeSimpleBMHierarchyEqualSetsUnderBMBar) { | 2004 MC_MergeSimpleBMHierarchyEqualSetsUnderBMBar) { |
| 2018 ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; | 2005 ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; |
| 2019 BookmarkModel* bm0 = GetBookmarkModel(0); | 2006 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 2020 BookmarkModel* bm1 = GetBookmarkModel(1); | 2007 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 2021 ui_test_utils::WaitForBookmarkModelToLoad(bm1); | 2008 ui_test_utils::WaitForBookmarkModelToLoad(bm1); |
| 2022 | 2009 |
| 2023 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 2010 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 2024 const BookmarkNode* bm_bar1 = bm1->GetBookmarkBarNode(); | 2011 const BookmarkNode* bm_bar1 = bm1->GetBookmarkBarNode(); |
| 2025 | 2012 |
| 2026 // Let's add same bookmarks (without favicon) to both clients. | 2013 // Let's add same bookmarks (without favicon) to both clients. |
| 2027 for (int index = 0; index < 3 ; index++) { | 2014 for (int index = 0; index < 3 ; index++) { |
| 2028 wstring title(L"TestBookmark"); | 2015 wstring title(L"TestBookmark"); |
| 2029 title.append(IntToWString(index)); | 2016 title.append(IntToWString(index)); |
| 2030 string url("http://www.nofaviconurl"); | 2017 string url("http://www.nofaviconurl"); |
| 2031 url.append(IntToString(index)); | 2018 url.append(IntToString(index)); |
| 2032 url.append(".com"); | 2019 url.append(".com"); |
| 2033 const BookmarkNode* nofavicon_bm_client0 = | 2020 const BookmarkNode* nofavicon_bm_client0 = |
| 2034 bm0->AddURL(bm_bar0, index, title, GURL(url)); | 2021 bm0->AddURL(bm_bar0, index, title, GURL(url)); |
| 2035 ASSERT_TRUE(nofavicon_bm_client0 != NULL); | 2022 ASSERT_TRUE(nofavicon_bm_client0 != NULL); |
| 2036 const BookmarkNode* nofavicon_bm_client1 = | 2023 const BookmarkNode* nofavicon_bm_client1 = |
| 2037 bm1->AddURL(bm_bar1, index, title, GURL(url)); | 2024 bm1->AddURL(bm_bar1, index, title, GURL(url)); |
| 2038 ASSERT_TRUE(nofavicon_bm_client1 != NULL); | 2025 ASSERT_TRUE(nofavicon_bm_client1 != NULL); |
| 2039 } | 2026 } |
| 2040 | 2027 |
| 2041 // Set up sync on both clients. | 2028 // Set up sync on both clients. |
| 2042 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 2029 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 2043 | 2030 |
| 2044 // Wait for changes to propagate. | 2031 // Wait for changes to propagate. |
| 2045 ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0))); | 2032 ASSERT_TRUE(ProfileSyncServiceTestHarness::AwaitQuiescence(clients())); |
| 2046 // Let's make sure there aren't any duplicates after sync. | 2033 // Let's make sure there aren't any duplicates after sync. |
| 2047 BookmarkModelVerifier::VerifyNoDuplicates(bm0); | 2034 BookmarkModelVerifier::VerifyNoDuplicates(bm0); |
| 2048 // Let's compare and make sure both bookmark models are same after sync. | 2035 // Let's compare and make sure both bookmark models are same after sync. |
| 2049 BookmarkModelVerifier::ExpectModelsMatchIncludingFavicon( | 2036 BookmarkModelVerifier::ExpectModelsMatchIncludingFavicon( |
| 2050 bm0, bm1, false); | 2037 bm0, bm1, false); |
| 2051 } | 2038 } |
| OLD | NEW |