| 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 <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "ui/app_list/app_list_model.h" | 9 #include "ui/app_list/app_list_model.h" |
| 10 #include "ui/app_list/test/app_list_test_view_delegate.h" | 10 #include "ui/app_list/test/app_list_test_view_delegate.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 AppListTestViewDelegate view_delegate_; | 76 AppListTestViewDelegate view_delegate_; |
| 77 scoped_ptr<SearchResultPageView> view_; | 77 scoped_ptr<SearchResultPageView> view_; |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(SearchResultPageViewTest); | 79 DISALLOW_COPY_AND_ASSIGN(SearchResultPageViewTest); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 TEST_F(SearchResultPageViewTest, Basic) { | 82 TEST_F(SearchResultPageViewTest, Basic) { |
| 83 std::map<SearchResult::DisplayType, int> result_types; | 83 std::map<SearchResult::DisplayType, int> result_types; |
| 84 const int kListResults = 2; | 84 const int kListResults = 2; |
| 85 const int kTileResults = 1; | 85 const int kTileResults = 1; |
| 86 const int kNoneResults = 3; |
| 86 result_types[SearchResult::DISPLAY_LIST] = kListResults; | 87 result_types[SearchResult::DISPLAY_LIST] = kListResults; |
| 87 result_types[SearchResult::DISPLAY_TILE] = kTileResults; | 88 result_types[SearchResult::DISPLAY_TILE] = kTileResults; |
| 89 result_types[SearchResult::DISPLAY_NONE] = kNoneResults; |
| 88 | 90 |
| 89 SetUpSearchResults(result_types); | 91 SetUpSearchResults(result_types); |
| 90 EXPECT_EQ(0, GetSelectedIndex()); | 92 EXPECT_EQ(0, GetSelectedIndex()); |
| 91 EXPECT_EQ(0, list_view()->selected_index()); | 93 EXPECT_EQ(0, list_view()->selected_index()); |
| 92 | 94 |
| 93 // Navigate to the second result in the list view. | 95 // Navigate to the second result in the list view. |
| 94 EXPECT_TRUE(KeyPress(ui::VKEY_DOWN)); | 96 EXPECT_TRUE(KeyPress(ui::VKEY_DOWN)); |
| 95 EXPECT_EQ(0, GetSelectedIndex()); | 97 EXPECT_EQ(0, GetSelectedIndex()); |
| 96 EXPECT_EQ(1, list_view()->selected_index()); | 98 EXPECT_EQ(1, list_view()->selected_index()); |
| 97 | 99 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 115 // Navigate off top of list. | 117 // Navigate off top of list. |
| 116 EXPECT_TRUE(KeyPress(ui::VKEY_UP)); | 118 EXPECT_TRUE(KeyPress(ui::VKEY_UP)); |
| 117 EXPECT_EQ(0, list_view()->selected_index()); | 119 EXPECT_EQ(0, list_view()->selected_index()); |
| 118 EXPECT_FALSE(KeyPress(ui::VKEY_UP)); | 120 EXPECT_FALSE(KeyPress(ui::VKEY_UP)); |
| 119 EXPECT_EQ(0, list_view()->selected_index()); | 121 EXPECT_EQ(0, list_view()->selected_index()); |
| 120 EXPECT_EQ(0, GetSelectedIndex()); | 122 EXPECT_EQ(0, GetSelectedIndex()); |
| 121 } | 123 } |
| 122 | 124 |
| 123 } // namespace test | 125 } // namespace test |
| 124 } // namespace app_list | 126 } // namespace app_list |
| OLD | NEW |