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 #include "ui/app_list/pagination_model.h" | 5 #include "ui/app_list/pagination_model.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 }; | 99 }; |
100 | 100 |
101 class PaginationModelTest : public testing::Test { | 101 class PaginationModelTest : public testing::Test { |
102 public: | 102 public: |
103 PaginationModelTest() {} | 103 PaginationModelTest() {} |
104 virtual ~PaginationModelTest() {} | 104 virtual ~PaginationModelTest() {} |
105 | 105 |
106 // testing::Test overrides: | 106 // testing::Test overrides: |
107 virtual void SetUp() OVERRIDE { | 107 virtual void SetUp() OVERRIDE { |
108 pagination_.SetTotalPages(5); | 108 pagination_.SetTotalPages(5); |
109 pagination_.SetTransitionDuration(1); | 109 pagination_.SetTransitionDurations(1, 1); |
110 observer_.set_model(&pagination_); | 110 observer_.set_model(&pagination_); |
111 pagination_.AddObserver(&observer_); | 111 pagination_.AddObserver(&observer_); |
112 } | 112 } |
113 virtual void TearDown() OVERRIDE { | 113 virtual void TearDown() OVERRIDE { |
114 pagination_.RemoveObserver(&observer_); | 114 pagination_.RemoveObserver(&observer_); |
115 observer_.set_model(NULL); | 115 observer_.set_model(NULL); |
116 } | 116 } |
117 | 117 |
118 protected: | 118 protected: |
119 void SetStartPageAndExpects(int start_page, | 119 void SetStartPageAndExpects(int start_page, |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 EXPECT_EQ(1, pagination_.selected_page()); | 381 EXPECT_EQ(1, pagination_.selected_page()); |
382 | 382 |
383 // But if the currently selected_page exceeds the total number of pages, | 383 // But if the currently selected_page exceeds the total number of pages, |
384 // it automatically switches to the last page. | 384 // it automatically switches to the last page. |
385 pagination_.SetTotalPages(1); | 385 pagination_.SetTotalPages(1); |
386 EXPECT_EQ(0, pagination_.selected_page()); | 386 EXPECT_EQ(0, pagination_.selected_page()); |
387 } | 387 } |
388 | 388 |
389 } // namespace test | 389 } // namespace test |
390 } // namespace app_list | 390 } // namespace app_list |
OLD | NEW |