| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 } | 265 } |
| 266 | 266 |
| 267 | 267 |
| 268 // The transaction on which everything happens. | 268 // The transaction on which everything happens. |
| 269 syncer::WriteTransaction *trans_; | 269 syncer::WriteTransaction *trans_; |
| 270 | 270 |
| 271 // The change list we construct. | 271 // The change list we construct. |
| 272 syncer::ChangeRecordList changes_; | 272 syncer::ChangeRecordList changes_; |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 class ExtensiveChangesBookmarkModelObserver : public BaseBookmarkModelObserver { | 275 class ExtensiveChangesBookmarkModelObserver |
| 276 : public bookmarks::BaseBookmarkModelObserver { |
| 276 public: | 277 public: |
| 277 ExtensiveChangesBookmarkModelObserver() | 278 ExtensiveChangesBookmarkModelObserver() |
| 278 : started_count_(0), | 279 : started_count_(0), |
| 279 completed_count_at_started_(0), | 280 completed_count_at_started_(0), |
| 280 completed_count_(0) {} | 281 completed_count_(0) {} |
| 281 | 282 |
| 282 void ExtensiveBookmarkChangesBeginning(BookmarkModel* model) override { | 283 void ExtensiveBookmarkChangesBeginning(BookmarkModel* model) override { |
| 283 ++started_count_; | 284 ++started_count_; |
| 284 completed_count_at_started_ = completed_count_; | 285 completed_count_at_started_ = completed_count_; |
| 285 } | 286 } |
| (...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2184 ExpectModelMatch(); | 2185 ExpectModelMatch(); |
| 2185 | 2186 |
| 2186 // Then simulate the add call arriving late. | 2187 // Then simulate the add call arriving late. |
| 2187 change_processor_->BookmarkNodeAdded(model_, model_->bookmark_bar_node(), 0); | 2188 change_processor_->BookmarkNodeAdded(model_, model_->bookmark_bar_node(), 0); |
| 2188 ExpectModelMatch(); | 2189 ExpectModelMatch(); |
| 2189 } | 2190 } |
| 2190 | 2191 |
| 2191 } // namespace | 2192 } // namespace |
| 2192 | 2193 |
| 2193 } // namespace browser_sync | 2194 } // namespace browser_sync |
| OLD | NEW |