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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 virtual void ExtensiveBookmarkChangesBeginning( |
283 BookmarkModel* model) OVERRIDE { | 283 BookmarkModel* model) override { |
284 ++started_count_; | 284 ++started_count_; |
285 completed_count_at_started_ = completed_count_; | 285 completed_count_at_started_ = completed_count_; |
286 } | 286 } |
287 | 287 |
288 virtual void ExtensiveBookmarkChangesEnded(BookmarkModel* model) OVERRIDE { | 288 virtual void ExtensiveBookmarkChangesEnded(BookmarkModel* model) override { |
289 ++completed_count_; | 289 ++completed_count_; |
290 } | 290 } |
291 | 291 |
292 virtual void BookmarkModelChanged() OVERRIDE {} | 292 virtual void BookmarkModelChanged() override {} |
293 | 293 |
294 int get_started() const { | 294 int get_started() const { |
295 return started_count_; | 295 return started_count_; |
296 } | 296 } |
297 | 297 |
298 int get_completed_count_at_started() const { | 298 int get_completed_count_at_started() const { |
299 return completed_count_at_started_; | 299 return completed_count_at_started_; |
300 } | 300 } |
301 | 301 |
302 int get_completed() const { | 302 int get_completed() const { |
(...skipping 1882 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 |