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