OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/views/app_list_view.h" | 5 #include "ui/app_list/views/app_list_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 PaginationModel* AppListViewTestContext::GetPaginationModel() { | 231 PaginationModel* AppListViewTestContext::GetPaginationModel() { |
232 return view_->GetAppsPaginationModel(); | 232 return view_->GetAppsPaginationModel(); |
233 } | 233 } |
234 | 234 |
235 void AppListViewTestContext::RunDisplayTest() { | 235 void AppListViewTestContext::RunDisplayTest() { |
236 EXPECT_FALSE(view_->GetWidget()->IsVisible()); | 236 EXPECT_FALSE(view_->GetWidget()->IsVisible()); |
237 EXPECT_EQ(-1, GetPaginationModel()->total_pages()); | 237 EXPECT_EQ(-1, GetPaginationModel()->total_pages()); |
238 delegate_->GetTestModel()->PopulateApps(kInitialItems); | 238 delegate_->GetTestModel()->PopulateApps(kInitialItems); |
239 | 239 |
240 Show(); | 240 Show(); |
| 241 |
| 242 // The landscape app launcher needs to be short enough to accomodate the |
| 243 // virtual keyboard because it is enabled by default when the virtual keyboard |
| 244 // is enabled. |
| 245 if (test_type_ == LANDSCAPE) |
| 246 EXPECT_GE(403, view_->bounds().height()); |
| 247 |
241 if (is_landscape()) | 248 if (is_landscape()) |
242 EXPECT_EQ(2, GetPaginationModel()->total_pages()); | 249 EXPECT_EQ(2, GetPaginationModel()->total_pages()); |
243 else | 250 else |
244 EXPECT_EQ(3, GetPaginationModel()->total_pages()); | 251 EXPECT_EQ(3, GetPaginationModel()->total_pages()); |
245 EXPECT_EQ(0, GetPaginationModel()->selected_page()); | 252 EXPECT_EQ(0, GetPaginationModel()->selected_page()); |
246 | 253 |
247 // Checks on the main view. | 254 // Checks on the main view. |
248 AppListMainView* main_view = view_->app_list_main_view(); | 255 AppListMainView* main_view = view_->app_list_main_view(); |
249 EXPECT_NO_FATAL_FAILURE(CheckView(main_view)); | 256 EXPECT_NO_FATAL_FAILURE(CheckView(main_view)); |
250 EXPECT_NO_FATAL_FAILURE(CheckView(main_view->contents_view())); | 257 EXPECT_NO_FATAL_FAILURE(CheckView(main_view->contents_view())); |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 INSTANTIATE_TEST_CASE_P(AppListViewTestAuraInstance, | 693 INSTANTIATE_TEST_CASE_P(AppListViewTestAuraInstance, |
687 AppListViewTestAura, | 694 AppListViewTestAura, |
688 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); | 695 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); |
689 | 696 |
690 INSTANTIATE_TEST_CASE_P(AppListViewTestDesktopInstance, | 697 INSTANTIATE_TEST_CASE_P(AppListViewTestDesktopInstance, |
691 AppListViewTestDesktop, | 698 AppListViewTestDesktop, |
692 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); | 699 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); |
693 | 700 |
694 } // namespace test | 701 } // namespace test |
695 } // namespace app_list | 702 } // namespace app_list |
OLD | NEW |