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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 | 241 |
242 // The landscape app launcher needs to be short enough to accomodate the | 242 // Explicitly enforce the exact dimensions of the app list. Feel free to |
243 // virtual keyboard because it is enabled by default when the virtual keyboard | 243 // change these if you need to (they are just here to prevent against |
244 // is enabled. | 244 // accidental changes to the window size). |
245 if (test_type_ == LANDSCAPE) | 245 switch (test_type_) { |
246 EXPECT_GE(403, view_->bounds().height()); | 246 case NORMAL: |
247 EXPECT_EQ("400x500", view_->bounds().size().ToString()); | |
248 break; | |
249 case LANDSCAPE: | |
250 // NOTE: Height should exceed 402, because otherwise there might not be | |
calamity
2014/09/22 03:50:45
'should not'?
Matt Giuca
2014/09/22 04:00:45
Done.
| |
251 // enough space to accomodate the virtual keyboard. (LANDSCAPE mode is | |
252 // enabled by default when the virtual keyboard is enabled.) | |
253 EXPECT_EQ("576x402", view_->bounds().size().ToString()); | |
254 break; | |
255 case EXPERIMENTAL: | |
256 EXPECT_EQ("768x560", view_->bounds().size().ToString()); | |
257 break; | |
258 default: | |
259 NOTREACHED(); | |
260 break; | |
261 } | |
247 | 262 |
248 if (is_landscape()) | 263 if (is_landscape()) |
249 EXPECT_EQ(2, GetPaginationModel()->total_pages()); | 264 EXPECT_EQ(2, GetPaginationModel()->total_pages()); |
250 else | 265 else |
251 EXPECT_EQ(3, GetPaginationModel()->total_pages()); | 266 EXPECT_EQ(3, GetPaginationModel()->total_pages()); |
252 EXPECT_EQ(0, GetPaginationModel()->selected_page()); | 267 EXPECT_EQ(0, GetPaginationModel()->selected_page()); |
253 | 268 |
254 // Checks on the main view. | 269 // Checks on the main view. |
255 AppListMainView* main_view = view_->app_list_main_view(); | 270 AppListMainView* main_view = view_->app_list_main_view(); |
256 EXPECT_NO_FATAL_FAILURE(CheckView(main_view)); | 271 EXPECT_NO_FATAL_FAILURE(CheckView(main_view)); |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
693 INSTANTIATE_TEST_CASE_P(AppListViewTestAuraInstance, | 708 INSTANTIATE_TEST_CASE_P(AppListViewTestAuraInstance, |
694 AppListViewTestAura, | 709 AppListViewTestAura, |
695 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); | 710 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); |
696 | 711 |
697 INSTANTIATE_TEST_CASE_P(AppListViewTestDesktopInstance, | 712 INSTANTIATE_TEST_CASE_P(AppListViewTestDesktopInstance, |
698 AppListViewTestDesktop, | 713 AppListViewTestDesktop, |
699 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); | 714 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); |
700 | 715 |
701 } // namespace test | 716 } // namespace test |
702 } // namespace app_list | 717 } // namespace app_list |
OLD | NEW |