| 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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 v->Remove(bm0, bm_bar0, 0); | 935 v->Remove(bm0, bm_bar0, 0); |
| 936 | 936 |
| 937 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 937 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 938 v->ExpectMatch(bm0); | 938 v->ExpectMatch(bm0); |
| 939 v->ExpectMatch(bm1); | 939 v->ExpectMatch(bm1); |
| 940 } | 940 } |
| 941 | 941 |
| 942 // Test Scribe ID - 371879. | 942 // Test Scribe ID - 371879. |
| 943 // TODO(rsimha): This currently fails due to http://crbug.com/50306. | 943 // TODO(rsimha): This currently fails due to http://crbug.com/50306. |
| 944 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 944 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 945 FAILS_SC_DelBMFoldWithBMsNonEmptyAccountAfterwards) { | 945 SC_DelBMFoldWithBMsNonEmptyAccountAfterwards) { |
| 946 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 946 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 947 BookmarkModelVerifier* v = verifier_helper(); | 947 BookmarkModelVerifier* v = verifier_helper(); |
| 948 BookmarkModel* bm0 = GetBookmarkModel(0); | 948 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 949 BookmarkModel* bm1 = GetBookmarkModel(1); | 949 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 950 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 950 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 951 ASSERT_TRUE(bm_bar0 != NULL); | 951 ASSERT_TRUE(bm_bar0 != NULL); |
| 952 const BookmarkNode* bm_other0 = bm0->other_node(); | 952 const BookmarkNode* bm_other0 = bm0->other_node(); |
| 953 ASSERT_TRUE(bm_other0 != NULL); | 953 ASSERT_TRUE(bm_other0 != NULL); |
| 954 | 954 |
| 955 v->ExpectMatch(bm0); | 955 v->ExpectMatch(bm0); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 // Let's delete the bookmark folder (bm_folder_one) | 1001 // Let's delete the bookmark folder (bm_folder_one) |
| 1002 v->Remove(bm0, bm_bar0, 1); | 1002 v->Remove(bm0, bm_bar0, 1); |
| 1003 | 1003 |
| 1004 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1004 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1005 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); | 1005 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
| 1006 } | 1006 } |
| 1007 | 1007 |
| 1008 // Test Scribe ID - 371880. | 1008 // Test Scribe ID - 371880. |
| 1009 // TODO(rsimha): This currently fails due to http://crbug.com/50306. | 1009 // TODO(rsimha): This currently fails due to http://crbug.com/50306. |
| 1010 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1010 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1011 FAILS_SC_DelBMFoldWithBMsAndBMFoldsNonEmptyACAfterwards) { | 1011 SC_DelBMFoldWithBMsAndBMFoldsNonEmptyACAfterwards) { |
| 1012 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1012 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1013 BookmarkModelVerifier* v = verifier_helper(); | 1013 BookmarkModelVerifier* v = verifier_helper(); |
| 1014 BookmarkModel* bm0 = GetBookmarkModel(0); | 1014 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1015 BookmarkModel* bm1 = GetBookmarkModel(1); | 1015 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1016 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1016 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 1017 const BookmarkNode* bm_other0 = bm0->other_node(); | 1017 const BookmarkNode* bm_other0 = bm0->other_node(); |
| 1018 ASSERT_TRUE(bm_other0 != NULL); | 1018 ASSERT_TRUE(bm_other0 != NULL); |
| 1019 | 1019 |
| 1020 v->ExpectMatch(bm0); | 1020 v->ExpectMatch(bm0); |
| 1021 v->ExpectMatch(bm1); | 1021 v->ExpectMatch(bm1); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 // Let's delete the bookmark folder (bm_folder_one) | 1103 // Let's delete the bookmark folder (bm_folder_one) |
| 1104 v->Remove(bm0, bm_bar0, 1); | 1104 v->Remove(bm0, bm_bar0, 1); |
| 1105 | 1105 |
| 1106 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1106 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 1107 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); | 1107 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
| 1108 } | 1108 } |
| 1109 | 1109 |
| 1110 // Test Scribe ID - 371882. | 1110 // Test Scribe ID - 371882. |
| 1111 // TODO(rsimha): This currently fails due to http://crbug.com/50306. | 1111 // TODO(rsimha): This currently fails due to http://crbug.com/50306. |
| 1112 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1112 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
| 1113 FAILS_SC_DelBMFoldWithParentAndChildrenBMsAndBMFolds) { | 1113 SC_DelBMFoldWithParentAndChildrenBMsAndBMFolds) { |
| 1114 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1114 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 1115 BookmarkModelVerifier* v = verifier_helper(); | 1115 BookmarkModelVerifier* v = verifier_helper(); |
| 1116 BookmarkModel* bm0 = GetBookmarkModel(0); | 1116 BookmarkModel* bm0 = GetBookmarkModel(0); |
| 1117 BookmarkModel* bm1 = GetBookmarkModel(1); | 1117 BookmarkModel* bm1 = GetBookmarkModel(1); |
| 1118 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1118 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
| 1119 | 1119 |
| 1120 v->ExpectMatch(bm0); | 1120 v->ExpectMatch(bm0); |
| 1121 v->ExpectMatch(bm1); | 1121 v->ExpectMatch(bm1); |
| 1122 | 1122 |
| 1123 // Let's add first bookmark folder to under bookmark_bar. | 1123 // Let's add first bookmark folder to under bookmark_bar. |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2029 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 2029 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 2030 | 2030 |
| 2031 // Wait for changes to propagate. | 2031 // Wait for changes to propagate. |
| 2032 ASSERT_TRUE(ProfileSyncServiceTestHarness::AwaitQuiescence(clients())); | 2032 ASSERT_TRUE(ProfileSyncServiceTestHarness::AwaitQuiescence(clients())); |
| 2033 // Let's make sure there aren't any duplicates after sync. | 2033 // Let's make sure there aren't any duplicates after sync. |
| 2034 BookmarkModelVerifier::VerifyNoDuplicates(bm0); | 2034 BookmarkModelVerifier::VerifyNoDuplicates(bm0); |
| 2035 // 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. |
| 2036 BookmarkModelVerifier::ExpectModelsMatchIncludingFavicon( | 2036 BookmarkModelVerifier::ExpectModelsMatchIncludingFavicon( |
| 2037 bm0, bm1, false); | 2037 bm0, bm1, false); |
| 2038 } | 2038 } |
| OLD | NEW |