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 "base/rand_util.h" | 5 #include "base/rand_util.h" |
6 #include "base/string16.h" | 6 #include "base/string16.h" |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/bookmarks/bookmark_utils.h" | 9 #include "chrome/browser/bookmarks/bookmark_utils.h" |
10 #include "chrome/test/live_sync/live_bookmarks_sync_test.h" | 10 #include "chrome/test/live_sync/live_bookmarks_sync_test.h" |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 | 942 |
943 // Let's delete the first empty bookmark folder | 943 // Let's delete the first empty bookmark folder |
944 v->Remove(bm0, bm_bar0, 0); | 944 v->Remove(bm0, bm_bar0, 0); |
945 | 945 |
946 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 946 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
947 v->ExpectMatch(bm0); | 947 v->ExpectMatch(bm0); |
948 v->ExpectMatch(bm1); | 948 v->ExpectMatch(bm1); |
949 } | 949 } |
950 | 950 |
951 // Test Scribe ID - 371879. | 951 // Test Scribe ID - 371879. |
952 // TODO(rsimha): This currently fails due to http://crbug.com/50306. | |
953 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 952 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
954 SC_DelBMFoldWithBMsNonEmptyAccountAfterwards) { | 953 SC_DelBMFoldWithBMsNonEmptyAccountAfterwards) { |
955 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 954 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
956 BookmarkModelVerifier* v = verifier_helper(); | 955 BookmarkModelVerifier* v = verifier_helper(); |
957 BookmarkModel* bm0 = GetBookmarkModel(0); | 956 BookmarkModel* bm0 = GetBookmarkModel(0); |
958 BookmarkModel* bm1 = GetBookmarkModel(1); | 957 BookmarkModel* bm1 = GetBookmarkModel(1); |
959 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 958 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
960 ASSERT_TRUE(bm_bar0 != NULL); | 959 ASSERT_TRUE(bm_bar0 != NULL); |
961 const BookmarkNode* bm_other0 = bm0->other_node(); | 960 const BookmarkNode* bm_other0 = bm0->other_node(); |
962 ASSERT_TRUE(bm_other0 != NULL); | 961 ASSERT_TRUE(bm_other0 != NULL); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); | 1007 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
1009 | 1008 |
1010 // Let's delete the bookmark folder (bm_folder_one) | 1009 // Let's delete the bookmark folder (bm_folder_one) |
1011 v->Remove(bm0, bm_bar0, 1); | 1010 v->Remove(bm0, bm_bar0, 1); |
1012 | 1011 |
1013 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1012 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
1014 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); | 1013 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
1015 } | 1014 } |
1016 | 1015 |
1017 // Test Scribe ID - 371880. | 1016 // Test Scribe ID - 371880. |
1018 // TODO(rsimha): This currently fails due to http://crbug.com/50306. | |
1019 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1017 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
1020 SC_DelBMFoldWithBMsAndBMFoldsNonEmptyACAfterwards) { | 1018 SC_DelBMFoldWithBMsAndBMFoldsNonEmptyACAfterwards) { |
1021 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1019 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
1022 BookmarkModelVerifier* v = verifier_helper(); | 1020 BookmarkModelVerifier* v = verifier_helper(); |
1023 BookmarkModel* bm0 = GetBookmarkModel(0); | 1021 BookmarkModel* bm0 = GetBookmarkModel(0); |
1024 BookmarkModel* bm1 = GetBookmarkModel(1); | 1022 BookmarkModel* bm1 = GetBookmarkModel(1); |
1025 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1023 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
1026 const BookmarkNode* bm_other0 = bm0->other_node(); | 1024 const BookmarkNode* bm_other0 = bm0->other_node(); |
1027 ASSERT_TRUE(bm_other0 != NULL); | 1025 ASSERT_TRUE(bm_other0 != NULL); |
1028 | 1026 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1110 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); | 1108 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
1111 | 1109 |
1112 // Let's delete the bookmark folder (bm_folder_one) | 1110 // Let's delete the bookmark folder (bm_folder_one) |
1113 v->Remove(bm0, bm_bar0, 1); | 1111 v->Remove(bm0, bm_bar0, 1); |
1114 | 1112 |
1115 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 1113 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
1116 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); | 1114 BookmarkModelVerifier::ExpectModelsMatch(bm0, bm1); |
1117 } | 1115 } |
1118 | 1116 |
1119 // Test Scribe ID - 371882. | 1117 // Test Scribe ID - 371882. |
1120 // TODO(rsimha): This currently fails due to http://crbug.com/50306. | |
1121 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, | 1118 IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, |
1122 SC_DelBMFoldWithParentAndChildrenBMsAndBMFolds) { | 1119 SC_DelBMFoldWithParentAndChildrenBMsAndBMFolds) { |
1123 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 1120 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
1124 BookmarkModelVerifier* v = verifier_helper(); | 1121 BookmarkModelVerifier* v = verifier_helper(); |
1125 BookmarkModel* bm0 = GetBookmarkModel(0); | 1122 BookmarkModel* bm0 = GetBookmarkModel(0); |
1126 BookmarkModel* bm1 = GetBookmarkModel(1); | 1123 BookmarkModel* bm1 = GetBookmarkModel(1); |
1127 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); | 1124 const BookmarkNode* bm_bar0 = bm0->GetBookmarkBarNode(); |
1128 | 1125 |
1129 v->ExpectMatch(bm0); | 1126 v->ExpectMatch(bm0); |
1130 v->ExpectMatch(bm1); | 1127 v->ExpectMatch(bm1); |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2038 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 2035 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
2039 | 2036 |
2040 // Wait for changes to propagate. | 2037 // Wait for changes to propagate. |
2041 ASSERT_TRUE(ProfileSyncServiceTestHarness::AwaitQuiescence(clients())); | 2038 ASSERT_TRUE(ProfileSyncServiceTestHarness::AwaitQuiescence(clients())); |
2042 // Let's make sure there aren't any duplicates after sync. | 2039 // Let's make sure there aren't any duplicates after sync. |
2043 BookmarkModelVerifier::VerifyNoDuplicates(bm0); | 2040 BookmarkModelVerifier::VerifyNoDuplicates(bm0); |
2044 // Let's compare and make sure both bookmark models are same after sync. | 2041 // Let's compare and make sure both bookmark models are same after sync. |
2045 BookmarkModelVerifier::ExpectModelsMatchIncludingFavicon( | 2042 BookmarkModelVerifier::ExpectModelsMatchIncludingFavicon( |
2046 bm0, bm1, false); | 2043 bm0, bm1, false); |
2047 } | 2044 } |
OLD | NEW |