Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: ui/app_list/search/mixer_unittest.cc

Issue 2253253002: [Merge to M53][Chrome OS] Change layout of the launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/app_list/search/mixer.cc ('k') | ui/app_list/search_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/search/mixer.h" 5 #include "ui/app_list/search/mixer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/memory/scoped_vector.h" 14 #include "base/memory/scoped_vector.h"
15 #include "base/metrics/field_trial.h" 15 #include "base/metrics/field_trial.h"
16 #include "base/strings/string16.h" 16 #include "base/strings/string16.h"
17 #include "base/strings/stringprintf.h" 17 #include "base/strings/stringprintf.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "base/test/mock_entropy_provider.h" 19 #include "base/test/mock_entropy_provider.h"
20 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
21 #include "ui/app_list/app_list_constants.h"
21 #include "ui/app_list/app_list_model.h" 22 #include "ui/app_list/app_list_model.h"
22 #include "ui/app_list/search/history_types.h" 23 #include "ui/app_list/search/history_types.h"
23 #include "ui/app_list/search_provider.h" 24 #include "ui/app_list/search_provider.h"
24 #include "ui/app_list/search_result.h" 25 #include "ui/app_list/search_result.h"
25 26
26 namespace app_list { 27 namespace app_list {
27 namespace test { 28 namespace test {
28 29
29 // Maximum number of results to show in each mixer group. 30 // Maximum number of results to show in each mixer group.
30 const size_t kMaxAppsGroupResults = 4; 31 const size_t kMaxAppsGroupResults = 4;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 152 }
152 153
153 void RunQuery() { 154 void RunQuery() {
154 const base::string16 query; 155 const base::string16 query;
155 156
156 for (size_t i = 0; i < providers_.size(); ++i) { 157 for (size_t i = 0; i < providers_.size(); ++i) {
157 providers_[i]->Start(is_voice_query_, query); 158 providers_[i]->Start(is_voice_query_, query);
158 providers_[i]->Stop(); 159 providers_[i]->Stop();
159 } 160 }
160 161
161 mixer_->MixAndPublish(is_voice_query_, known_results_); 162 mixer_->MixAndPublish(is_voice_query_, known_results_, kMaxSearchResults);
162 } 163 }
163 164
164 std::string GetResults() const { 165 std::string GetResults() const {
165 std::string result; 166 std::string result;
166 for (size_t i = 0; i < results_->item_count(); ++i) { 167 for (size_t i = 0; i < results_->item_count(); ++i) {
167 if (!result.empty()) 168 if (!result.empty())
168 result += ','; 169 result += ',';
169 170
170 result += base::UTF16ToUTF8(results_->GetItemAt(i)->title()); 171 result += base::UTF16ToUTF8(results_->GetItemAt(i)->title());
171 } 172 }
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 EXPECT_EQ(old_ui_result_ids[1], 428 EXPECT_EQ(old_ui_result_ids[1],
428 TestSearchResult::GetInstanceId(ui_results.GetItemAt(0))); 429 TestSearchResult::GetInstanceId(ui_results.GetItemAt(0)));
429 EXPECT_EQ(old_ui_result_ids[2], 430 EXPECT_EQ(old_ui_result_ids[2],
430 TestSearchResult::GetInstanceId(ui_results.GetItemAt(2))); 431 TestSearchResult::GetInstanceId(ui_results.GetItemAt(2)));
431 } 432 }
432 433
433 INSTANTIATE_TEST_CASE_P(MixerTestInstance, MixerTest, testing::Bool()); 434 INSTANTIATE_TEST_CASE_P(MixerTestInstance, MixerTest, testing::Bool());
434 435
435 } // namespace test 436 } // namespace test
436 } // namespace app_list 437 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/search/mixer.cc ('k') | ui/app_list/search_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698