| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 syncer::ChangeRecordList changes_; | 272 syncer::ChangeRecordList changes_; |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 class ExtensiveChangesBookmarkModelObserver : public BaseBookmarkModelObserver { | 275 class ExtensiveChangesBookmarkModelObserver : public BaseBookmarkModelObserver { |
| 276 public: | 276 public: |
| 277 explicit ExtensiveChangesBookmarkModelObserver() | 277 explicit ExtensiveChangesBookmarkModelObserver() |
| 278 : started_count_(0), | 278 : started_count_(0), |
| 279 completed_count_at_started_(0), | 279 completed_count_at_started_(0), |
| 280 completed_count_(0) {} | 280 completed_count_(0) {} |
| 281 | 281 |
| 282 virtual void ExtensiveBookmarkChangesBeginning( | 282 void ExtensiveBookmarkChangesBeginning(BookmarkModel* model) override { |
| 283 BookmarkModel* model) override { | |
| 284 ++started_count_; | 283 ++started_count_; |
| 285 completed_count_at_started_ = completed_count_; | 284 completed_count_at_started_ = completed_count_; |
| 286 } | 285 } |
| 287 | 286 |
| 288 virtual void ExtensiveBookmarkChangesEnded(BookmarkModel* model) override { | 287 void ExtensiveBookmarkChangesEnded(BookmarkModel* model) override { |
| 289 ++completed_count_; | 288 ++completed_count_; |
| 290 } | 289 } |
| 291 | 290 |
| 292 virtual void BookmarkModelChanged() override {} | 291 void BookmarkModelChanged() override {} |
| 293 | 292 |
| 294 int get_started() const { | 293 int get_started() const { |
| 295 return started_count_; | 294 return started_count_; |
| 296 } | 295 } |
| 297 | 296 |
| 298 int get_completed_count_at_started() const { | 297 int get_completed_count_at_started() const { |
| 299 return completed_count_at_started_; | 298 return completed_count_at_started_; |
| 300 } | 299 } |
| 301 | 300 |
| 302 int get_completed() const { | 301 int get_completed() const { |
| (...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2185 ExpectModelMatch(); | 2184 ExpectModelMatch(); |
| 2186 | 2185 |
| 2187 // Then simulate the add call arriving late. | 2186 // Then simulate the add call arriving late. |
| 2188 change_processor_->BookmarkNodeAdded(model_, model_->bookmark_bar_node(), 0); | 2187 change_processor_->BookmarkNodeAdded(model_, model_->bookmark_bar_node(), 0); |
| 2189 ExpectModelMatch(); | 2188 ExpectModelMatch(); |
| 2190 } | 2189 } |
| 2191 | 2190 |
| 2192 } // namespace | 2191 } // namespace |
| 2193 | 2192 |
| 2194 } // namespace browser_sync | 2193 } // namespace browser_sync |
| OLD | NEW |