Index: ui/app_list/views/app_list_view_unittest.cc |
diff --git a/ui/app_list/views/app_list_view_unittest.cc b/ui/app_list/views/app_list_view_unittest.cc |
index 5ead23f231f8331686d38a215181d2aff48411f2..ff0bbf1cea7aa99cd1ac5a56d4a65af79bdbaa72 100644 |
--- a/ui/app_list/views/app_list_view_unittest.cc |
+++ b/ui/app_list/views/app_list_view_unittest.cc |
@@ -99,9 +99,11 @@ class AppListViewTestContext { |
// Closes the app list. This sets |view_| to NULL. |
void Close(); |
+ // Gets the PaginationModel owned by |view_|. |
+ PaginationModel* GetPaginationModel(); |
+ |
const TestType test_type_; |
scoped_ptr<base::RunLoop> run_loop_; |
- PaginationModel pagination_model_; |
app_list::AppListView* view_; // Owned by native widget. |
app_list::test::AppListTestViewDelegate* delegate_; // Owned by |view_|; |
@@ -153,7 +155,6 @@ AppListViewTestContext::AppListViewTestContext(int test_type, |
// Initialize centered around a point that ensures the window is wholly shown. |
view_->InitAsBubbleAtFixedLocation(parent, |
- &pagination_model_, |
gfx::Point(300, 300), |
views::BubbleBorder::FLOAT, |
false /* border_accepts_events */); |
@@ -192,17 +193,21 @@ void AppListViewTestContext::Close() { |
EXPECT_FALSE(view_); |
} |
+PaginationModel* AppListViewTestContext::GetPaginationModel() { |
+ return view_->GetAppsPaginationModel(); |
+} |
+ |
void AppListViewTestContext::RunDisplayTest() { |
EXPECT_FALSE(view_->GetWidget()->IsVisible()); |
- EXPECT_EQ(-1, pagination_model_.total_pages()); |
+ EXPECT_EQ(-1, GetPaginationModel()->total_pages()); |
delegate_->GetTestModel()->PopulateApps(kInitialItems); |
Show(); |
if (is_landscape()) |
- EXPECT_EQ(2, pagination_model_.total_pages()); |
+ EXPECT_EQ(2, GetPaginationModel()->total_pages()); |
else |
- EXPECT_EQ(3, pagination_model_.total_pages()); |
- EXPECT_EQ(0, pagination_model_.selected_page()); |
+ EXPECT_EQ(3, GetPaginationModel()->total_pages()); |
+ EXPECT_EQ(0, GetPaginationModel()->selected_page()); |
// Checks on the main view. |
AppListMainView* main_view = view_->app_list_main_view(); |
@@ -215,7 +220,7 @@ void AppListViewTestContext::RunDisplayTest() { |
void AppListViewTestContext::RunReshowWithOpenFolderTest() { |
EXPECT_FALSE(view_->GetWidget()->IsVisible()); |
- EXPECT_EQ(-1, pagination_model_.total_pages()); |
+ EXPECT_EQ(-1, GetPaginationModel()->total_pages()); |
AppListTestModel* model = delegate_->GetTestModel(); |
model->PopulateApps(kInitialItems); |
@@ -259,7 +264,7 @@ void AppListViewTestContext::RunReshowWithOpenFolderTest() { |
void AppListViewTestContext::RunStartPageTest() { |
EXPECT_FALSE(view_->GetWidget()->IsVisible()); |
- EXPECT_EQ(-1, pagination_model_.total_pages()); |
+ EXPECT_EQ(-1, GetPaginationModel()->total_pages()); |
AppListTestModel* model = delegate_->GetTestModel(); |
model->PopulateApps(3); |