| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "app/table_model_observer.h" |
| 5 #include "base/string_util.h" | 6 #include "base/string_util.h" |
| 6 #include "base/time.h" | 7 #include "base/time.h" |
| 7 #include "chrome/browser/bookmarks/bookmark_table_model.h" | 8 #include "chrome/browser/bookmarks/bookmark_table_model.h" |
| 8 #include "chrome/test/testing_profile.h" | 9 #include "chrome/test/testing_profile.h" |
| 9 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "views/controls/table/table_model_observer.h" | |
| 12 | 12 |
| 13 using base::Time; | 13 using base::Time; |
| 14 using base::TimeDelta; | 14 using base::TimeDelta; |
| 15 | 15 |
| 16 // Base class for bookmark model tests. | 16 // Base class for bookmark model tests. |
| 17 // Initial state of the bookmark model is as follows: | 17 // Initial state of the bookmark model is as follows: |
| 18 // bb | 18 // bb |
| 19 // url1 (t0) | 19 // url1 (t0) |
| 20 // f1 | 20 // f1 |
| 21 // o | 21 // o |
| 22 // url2 (t0 + 2) | 22 // url2 (t0 + 2) |
| 23 // f2 | 23 // f2 |
| 24 // url3 (t0 + 1) | 24 // url3 (t0 + 1) |
| 25 class BookmarkTableModelTest : public testing::Test, | 25 class BookmarkTableModelTest : public testing::Test, |
| 26 public views::TableModelObserver { | 26 public TableModelObserver { |
| 27 public: | 27 public: |
| 28 BookmarkTableModelTest() | 28 BookmarkTableModelTest() |
| 29 : url1_("http://1"), | 29 : url1_("http://1"), |
| 30 url2_("http://2"), | 30 url2_("http://2"), |
| 31 url3_("http://3"), | 31 url3_("http://3"), |
| 32 changed_count_(0), | 32 changed_count_(0), |
| 33 item_changed_count_(0), | 33 item_changed_count_(0), |
| 34 added_count_(0), | 34 added_count_(0), |
| 35 removed_count_(0) { | 35 removed_count_(0) { |
| 36 } | 36 } |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 // Change a folder, this shouldn't change the model. | 311 // Change a folder, this shouldn't change the model. |
| 312 bookmark_model()->SetTitle(bookmark_model()->other_node()->GetChild(1), | 312 bookmark_model()->SetTitle(bookmark_model()->other_node()->GetChild(1), |
| 313 L"new"); | 313 L"new"); |
| 314 VerifyAndClearOberserverCounts(0, 0, 0, 0); | 314 VerifyAndClearOberserverCounts(0, 0, 0, 0); |
| 315 | 315 |
| 316 // Change a url that isn't in the model, this shouldn't send change. | 316 // Change a url that isn't in the model, this shouldn't send change. |
| 317 bookmark_model()->SetTitle(bookmark_model()->other_node()->GetChild(0), | 317 bookmark_model()->SetTitle(bookmark_model()->other_node()->GetChild(0), |
| 318 L"new"); | 318 L"new"); |
| 319 VerifyAndClearOberserverCounts(0, 0, 0, 0); | 319 VerifyAndClearOberserverCounts(0, 0, 0, 0); |
| 320 } | 320 } |
| OLD | NEW |