| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 return view_->GetAppsPaginationModel(); | 291 return view_->GetAppsPaginationModel(); |
| 292 } | 292 } |
| 293 | 293 |
| 294 void AppListViewTestContext::RunDisplayTest() { | 294 void AppListViewTestContext::RunDisplayTest() { |
| 295 EXPECT_FALSE(view_->GetWidget()->IsVisible()); | 295 EXPECT_FALSE(view_->GetWidget()->IsVisible()); |
| 296 EXPECT_EQ(-1, GetPaginationModel()->total_pages()); | 296 EXPECT_EQ(-1, GetPaginationModel()->total_pages()); |
| 297 delegate_->GetTestModel()->PopulateApps(kInitialItems); | 297 delegate_->GetTestModel()->PopulateApps(kInitialItems); |
| 298 | 298 |
| 299 Show(); | 299 Show(); |
| 300 | 300 |
| 301 #if defined(OS_CHROMEOS) |
| 301 // Explicitly enforce the exact dimensions of the app list. Feel free to | 302 // Explicitly enforce the exact dimensions of the app list. Feel free to |
| 302 // change these if you need to (they are just here to prevent against | 303 // change these if you need to (they are just here to prevent against |
| 303 // accidental changes to the window size). | 304 // accidental changes to the window size). |
| 305 // |
| 306 // Note: Only test this on Chrome OS; the deprecation banner on other |
| 307 // platforms makes the height variable so we can't reliably test it (nor do we |
| 308 // really need to). |
| 304 switch (test_type_) { | 309 switch (test_type_) { |
| 305 case NORMAL: | 310 case NORMAL: |
| 306 EXPECT_EQ("400x500", view_->bounds().size().ToString()); | 311 EXPECT_EQ("400x500", view_->bounds().size().ToString()); |
| 307 break; | 312 break; |
| 308 case LANDSCAPE: | 313 case LANDSCAPE: |
| 309 // NOTE: Height should not exceed 402, because otherwise there might not | 314 // NOTE: Height should not exceed 402, because otherwise there might not |
| 310 // be enough space to accomodate the virtual keyboard. (LANDSCAPE mode is | 315 // be enough space to accomodate the virtual keyboard. (LANDSCAPE mode is |
| 311 // enabled by default when the virtual keyboard is enabled.) | 316 // enabled by default when the virtual keyboard is enabled.) |
| 312 EXPECT_EQ("576x402", view_->bounds().size().ToString()); | 317 EXPECT_EQ("576x402", view_->bounds().size().ToString()); |
| 313 break; | 318 break; |
| 314 case EXPERIMENTAL: | 319 case EXPERIMENTAL: |
| 315 EXPECT_EQ("768x570", view_->bounds().size().ToString()); | 320 EXPECT_EQ("768x570", view_->bounds().size().ToString()); |
| 316 break; | 321 break; |
| 317 default: | 322 default: |
| 318 NOTREACHED(); | 323 NOTREACHED(); |
| 319 break; | 324 break; |
| 320 } | 325 } |
| 326 #endif // defined(OS_CHROMEOS) |
| 321 | 327 |
| 322 if (is_landscape()) | 328 if (is_landscape()) |
| 323 EXPECT_EQ(2, GetPaginationModel()->total_pages()); | 329 EXPECT_EQ(2, GetPaginationModel()->total_pages()); |
| 324 else | 330 else |
| 325 EXPECT_EQ(3, GetPaginationModel()->total_pages()); | 331 EXPECT_EQ(3, GetPaginationModel()->total_pages()); |
| 326 EXPECT_EQ(0, GetPaginationModel()->selected_page()); | 332 EXPECT_EQ(0, GetPaginationModel()->selected_page()); |
| 327 | 333 |
| 328 // Checks on the main view. | 334 // Checks on the main view. |
| 329 AppListMainView* main_view = view_->app_list_main_view(); | 335 AppListMainView* main_view = view_->app_list_main_view(); |
| 330 EXPECT_NO_FATAL_FAILURE(CheckView(main_view)); | 336 EXPECT_NO_FATAL_FAILURE(CheckView(main_view)); |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 AppListViewTestAura, | 853 AppListViewTestAura, |
| 848 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); | 854 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); |
| 849 #endif | 855 #endif |
| 850 | 856 |
| 851 INSTANTIATE_TEST_CASE_P(AppListViewTestDesktopInstance, | 857 INSTANTIATE_TEST_CASE_P(AppListViewTestDesktopInstance, |
| 852 AppListViewTestDesktop, | 858 AppListViewTestDesktop, |
| 853 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); | 859 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); |
| 854 | 860 |
| 855 } // namespace test | 861 } // namespace test |
| 856 } // namespace app_list | 862 } // namespace app_list |
| OLD | NEW |