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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 view_->GetWidget()->Close(); | 266 view_->GetWidget()->Close(); |
267 run_loop_.reset(new base::RunLoop); | 267 run_loop_.reset(new base::RunLoop); |
268 run_loop_->Run(); | 268 run_loop_->Run(); |
269 | 269 |
270 // |view_| should have been deleted and set to NULL via ViewClosing(). | 270 // |view_| should have been deleted and set to NULL via ViewClosing(). |
271 EXPECT_FALSE(view_); | 271 EXPECT_FALSE(view_); |
272 } | 272 } |
273 | 273 |
274 bool AppListViewTestContext::CheckSearchBoxWidget(const gfx::Rect& expected) { | 274 bool AppListViewTestContext::CheckSearchBoxWidget(const gfx::Rect& expected) { |
275 ContentsView* contents_view = view_->app_list_main_view()->contents_view(); | 275 ContentsView* contents_view = view_->app_list_main_view()->contents_view(); |
276 gfx::Point point = expected.origin(); | 276 // Adjust for the search box view's shadow. |
| 277 gfx::Rect expected_with_shadow = |
| 278 view_->app_list_main_view() |
| 279 ->search_box_view() |
| 280 ->GetViewBoundsForSearchBoxContentsBounds(expected); |
| 281 gfx::Point point = expected_with_shadow.origin(); |
277 views::View::ConvertPointToScreen(contents_view, &point); | 282 views::View::ConvertPointToScreen(contents_view, &point); |
278 | 283 |
279 return gfx::Rect(point, expected.size()) == | 284 return gfx::Rect(point, expected_with_shadow.size()) == |
280 view_->search_box_widget()->GetWindowBoundsInScreen(); | 285 view_->search_box_widget()->GetWindowBoundsInScreen(); |
281 } | 286 } |
282 | 287 |
283 PaginationModel* AppListViewTestContext::GetPaginationModel() { | 288 PaginationModel* AppListViewTestContext::GetPaginationModel() { |
284 return view_->GetAppsPaginationModel(); | 289 return view_->GetAppsPaginationModel(); |
285 } | 290 } |
286 | 291 |
287 void AppListViewTestContext::RunDisplayTest() { | 292 void AppListViewTestContext::RunDisplayTest() { |
288 EXPECT_FALSE(view_->GetWidget()->IsVisible()); | 293 EXPECT_FALSE(view_->GetWidget()->IsVisible()); |
289 EXPECT_EQ(-1, GetPaginationModel()->total_pages()); | 294 EXPECT_EQ(-1, GetPaginationModel()->total_pages()); |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 AppListViewTestAura, | 833 AppListViewTestAura, |
829 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); | 834 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); |
830 #endif | 835 #endif |
831 | 836 |
832 INSTANTIATE_TEST_CASE_P(AppListViewTestDesktopInstance, | 837 INSTANTIATE_TEST_CASE_P(AppListViewTestDesktopInstance, |
833 AppListViewTestDesktop, | 838 AppListViewTestDesktop, |
834 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); | 839 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); |
835 | 840 |
836 } // namespace test | 841 } // namespace test |
837 } // namespace app_list | 842 } // namespace app_list |
OLD | NEW |