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_list_view.h" | 5 #include "ui/app_list/views/search_result_list_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 | 118 |
119 ProgressBarView* GetProgressBarAt(size_t index) { | 119 ProgressBarView* GetProgressBarAt(size_t index) { |
120 return GetResultViewAt(index)->progress_bar_; | 120 return GetResultViewAt(index)->progress_bar_; |
121 } | 121 } |
122 | 122 |
123 private: | 123 private: |
124 void OnResultInstalled(SearchResult* result) override {} | 124 void OnResultInstalled(SearchResult* result) override {} |
125 | 125 |
126 AppListTestViewDelegate view_delegate_; | 126 AppListTestViewDelegate view_delegate_; |
127 scoped_ptr<SearchResultListView> view_; | 127 std::unique_ptr<SearchResultListView> view_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(SearchResultListViewTest); | 129 DISALLOW_COPY_AND_ASSIGN(SearchResultListViewTest); |
130 }; | 130 }; |
131 | 131 |
132 TEST_F(SearchResultListViewTest, Basic) { | 132 TEST_F(SearchResultListViewTest, Basic) { |
133 SetUpSearchResults(); | 133 SetUpSearchResults(); |
134 | 134 |
135 const int results = GetResultCount(); | 135 const int results = GetResultCount(); |
136 EXPECT_EQ(kDefaultSearchItems, results); | 136 EXPECT_EQ(kDefaultSearchItems, results); |
137 EXPECT_EQ(0, GetSelectedIndex()); | 137 EXPECT_EQ(0, GetSelectedIndex()); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 EXPECT_EQ(0.0f, GetProgressBarAt(0)->current_value()); | 246 EXPECT_EQ(0.0f, GetProgressBarAt(0)->current_value()); |
247 GetResults()->GetItemAt(0)->SetPercentDownloaded(10); | 247 GetResults()->GetItemAt(0)->SetPercentDownloaded(10); |
248 | 248 |
249 DeleteResultAt(0); | 249 DeleteResultAt(0); |
250 RunPendingMessages(); | 250 RunPendingMessages(); |
251 EXPECT_EQ(0.0f, GetProgressBarAt(0)->current_value()); | 251 EXPECT_EQ(0.0f, GetProgressBarAt(0)->current_value()); |
252 } | 252 } |
253 | 253 |
254 } // namespace test | 254 } // namespace test |
255 } // namespace app_list | 255 } // namespace app_list |
OLD | NEW |