OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // TODO(akalin): This file is basically just a unit test for | 5 // TODO(akalin): This file is basically just a unit test for |
6 // BookmarkChangeProcessor. Write unit tests for | 6 // BookmarkChangeProcessor. Write unit tests for |
7 // BookmarkModelAssociator separately. | 7 // BookmarkModelAssociator separately. |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 | 1156 |
1157 // Verify that the browser model matches the sync model. | 1157 // Verify that the browser model matches the sync model. |
1158 EXPECT_EQ(model_->other_node()->child_count(), count); | 1158 EXPECT_EQ(model_->other_node()->child_count(), count); |
1159 ExpectModelMatch(); | 1159 ExpectModelMatch(); |
1160 } | 1160 } |
1161 | 1161 |
1162 // Introduce a consistency violation into the model, and see that it | 1162 // Introduce a consistency violation into the model, and see that it |
1163 // puts itself into a lame, error state. | 1163 // puts itself into a lame, error state. |
1164 TEST_F(ProfileSyncServiceBookmarkTest, UnrecoverableErrorSuspendsService) { | 1164 TEST_F(ProfileSyncServiceBookmarkTest, UnrecoverableErrorSuspendsService) { |
1165 EXPECT_CALL(mock_error_handler_, | 1165 EXPECT_CALL(mock_error_handler_, |
1166 OnSingleDataTypeUnrecoverableError(_)); | 1166 OnSingleDatatypeUnrecoverableError(_, _)); |
1167 | 1167 |
1168 LoadBookmarkModel(DELETE_EXISTING_STORAGE, DONT_SAVE_TO_STORAGE); | 1168 LoadBookmarkModel(DELETE_EXISTING_STORAGE, DONT_SAVE_TO_STORAGE); |
1169 StartSync(); | 1169 StartSync(); |
1170 | 1170 |
1171 // Add a node which will be the target of the consistency violation. | 1171 // Add a node which will be the target of the consistency violation. |
1172 const BookmarkNode* node = | 1172 const BookmarkNode* node = |
1173 model_->AddFolder(model_->other_node(), 0, base::ASCIIToUTF16("node")); | 1173 model_->AddFolder(model_->other_node(), 0, base::ASCIIToUTF16("node")); |
1174 ExpectSyncerNodeMatching(node); | 1174 ExpectSyncerNodeMatching(node); |
1175 | 1175 |
1176 // Now destroy the syncer node as if we were the ProfileSyncService without | 1176 // Now destroy the syncer node as if we were the ProfileSyncService without |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2185 ExpectModelMatch(); | 2185 ExpectModelMatch(); |
2186 | 2186 |
2187 // Then simulate the add call arriving late. | 2187 // Then simulate the add call arriving late. |
2188 change_processor_->BookmarkNodeAdded(model_, model_->bookmark_bar_node(), 0); | 2188 change_processor_->BookmarkNodeAdded(model_, model_->bookmark_bar_node(), 0); |
2189 ExpectModelMatch(); | 2189 ExpectModelMatch(); |
2190 } | 2190 } |
2191 | 2191 |
2192 } // namespace | 2192 } // namespace |
2193 | 2193 |
2194 } // namespace browser_sync | 2194 } // namespace browser_sync |
OLD | NEW |