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/search_result_page_view.h" | 5 #include "ui/app_list/views/search_result_page_view.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 return view_->OnKeyPressed(event); | 87 return view_->OnKeyPressed(event); |
88 } | 88 } |
89 | 89 |
90 private: | 90 private: |
91 void OnResultInstalled(SearchResult* result) override {} | 91 void OnResultInstalled(SearchResult* result) override {} |
92 | 92 |
93 SearchResultListView* list_view_; | 93 SearchResultListView* list_view_; |
94 SearchResultTileItemListView* tile_list_view_; | 94 SearchResultTileItemListView* tile_list_view_; |
95 | 95 |
96 AppListTestViewDelegate view_delegate_; | 96 AppListTestViewDelegate view_delegate_; |
97 scoped_ptr<SearchResultPageView> view_; | 97 std::unique_ptr<SearchResultPageView> view_; |
98 scoped_ptr<views::Textfield> textfield_; | 98 std::unique_ptr<views::Textfield> textfield_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(SearchResultPageViewTest); | 100 DISALLOW_COPY_AND_ASSIGN(SearchResultPageViewTest); |
101 }; | 101 }; |
102 | 102 |
103 TEST_F(SearchResultPageViewTest, DirectionalMovement) { | 103 TEST_F(SearchResultPageViewTest, DirectionalMovement) { |
104 std::vector<std::pair<SearchResult::DisplayType, int>> result_types; | 104 std::vector<std::pair<SearchResult::DisplayType, int>> result_types; |
105 // 3 tile results, followed by 2 list results. | 105 // 3 tile results, followed by 2 list results. |
106 const int kTileResults = 3; | 106 const int kTileResults = 3; |
107 const int kListResults = 2; | 107 const int kListResults = 2; |
108 const int kNoneResults = 3; | 108 const int kNoneResults = 3; |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 327 } |
328 | 328 |
329 // The selected container has vanished so we reset the selection to 0. | 329 // The selected container has vanished so we reset the selection to 0. |
330 EXPECT_EQ(0, GetSelectedIndex()); | 330 EXPECT_EQ(0, GetSelectedIndex()); |
331 EXPECT_EQ(-1, tile_list_view()->selected_index()); | 331 EXPECT_EQ(-1, tile_list_view()->selected_index()); |
332 EXPECT_EQ(0, list_view()->selected_index()); | 332 EXPECT_EQ(0, list_view()->selected_index()); |
333 } | 333 } |
334 | 334 |
335 } // namespace test | 335 } // namespace test |
336 } // namespace app_list | 336 } // namespace app_list |
OLD | NEW |