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

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

Issue 2225073002: [Chrome OS] Change layout of the launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase & scale the Google Doodle image when it's too large. 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/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 #include "ui/app_list/app_list_constants.h"
19 #include "ui/app_list/app_list_model.h" 20 #include "ui/app_list/app_list_model.h"
20 #include "ui/app_list/search/history_types.h" 21 #include "ui/app_list/search/history_types.h"
21 #include "ui/app_list/search_provider.h" 22 #include "ui/app_list/search_provider.h"
22 #include "ui/app_list/search_result.h" 23 #include "ui/app_list/search_result.h"
23 24
24 namespace app_list { 25 namespace app_list {
25 namespace test { 26 namespace test {
26 27
27 // Maximum number of results to show in each mixer group. 28 // Maximum number of results to show in each mixer group.
28 const size_t kMaxAppsGroupResults = 4; 29 const size_t kMaxAppsGroupResults = 4;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 140 }
140 141
141 void RunQuery() { 142 void RunQuery() {
142 const base::string16 query; 143 const base::string16 query;
143 144
144 for (size_t i = 0; i < providers_.size(); ++i) { 145 for (size_t i = 0; i < providers_.size(); ++i) {
145 providers_[i]->Start(is_voice_query_, query); 146 providers_[i]->Start(is_voice_query_, query);
146 providers_[i]->Stop(); 147 providers_[i]->Stop();
147 } 148 }
148 149
149 mixer_->MixAndPublish(is_voice_query_, known_results_); 150 mixer_->MixAndPublish(is_voice_query_, known_results_, kMaxSearchResults);
150 } 151 }
151 152
152 std::string GetResults() const { 153 std::string GetResults() const {
153 std::string result; 154 std::string result;
154 for (size_t i = 0; i < results_->item_count(); ++i) { 155 for (size_t i = 0; i < results_->item_count(); ++i) {
155 if (!result.empty()) 156 if (!result.empty())
156 result += ','; 157 result += ',';
157 158
158 result += base::UTF16ToUTF8(results_->GetItemAt(i)->title()); 159 result += base::UTF16ToUTF8(results_->GetItemAt(i)->title());
159 } 160 }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 EXPECT_EQ(old_ui_result_ids[0], 403 EXPECT_EQ(old_ui_result_ids[0],
403 TestSearchResult::GetInstanceId(ui_results.GetItemAt(3))); 404 TestSearchResult::GetInstanceId(ui_results.GetItemAt(3)));
404 EXPECT_EQ(old_ui_result_ids[1], 405 EXPECT_EQ(old_ui_result_ids[1],
405 TestSearchResult::GetInstanceId(ui_results.GetItemAt(0))); 406 TestSearchResult::GetInstanceId(ui_results.GetItemAt(0)));
406 EXPECT_EQ(old_ui_result_ids[2], 407 EXPECT_EQ(old_ui_result_ids[2],
407 TestSearchResult::GetInstanceId(ui_results.GetItemAt(2))); 408 TestSearchResult::GetInstanceId(ui_results.GetItemAt(2)));
408 } 409 }
409 410
410 } // namespace test 411 } // namespace test
411 } // namespace app_list 412 } // 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