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

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

Issue 1139493004: Minor refactor to support experiments in AppListMixer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@applist-tokenized-exponential
Patch Set: Fix compile. Created 5 years, 7 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') | no next file » | 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "ui/app_list/app_list_model.h" 13 #include "ui/app_list/app_list_model.h"
14 #include "ui/app_list/search/history_types.h" 14 #include "ui/app_list/search/history_types.h"
15 #include "ui/app_list/search/mixer.h" 15 #include "ui/app_list/search/mixer.h"
16 #include "ui/app_list/search_provider.h" 16 #include "ui/app_list/search_provider.h"
17 #include "ui/app_list/search_result.h" 17 #include "ui/app_list/search_result.h"
18 18
19 namespace app_list { 19 namespace app_list {
20 namespace test { 20 namespace test {
21 21
22 // Maximum number of results to show in each mixer group. 22 // Maximum number of results to show in each mixer group.
23 const size_t kMaxAppsGroupResults = 4; 23 const size_t kMaxAppsGroupResults = 4;
24 const size_t kMaxOmniboxResults = 0; // Unlimited. 24 const size_t kMaxOmniboxResults = 0; // Ignored.
25 const size_t kMaxWebstoreResults = 2; 25 const size_t kMaxWebstoreResults = 2;
26 const size_t kMaxPeopleResults = 2; 26 const size_t kMaxPeopleResults = 2;
27 27
28 class TestSearchResult : public SearchResult { 28 class TestSearchResult : public SearchResult {
29 public: 29 public:
30 TestSearchResult(const std::string& id, double relevance) 30 TestSearchResult(const std::string& id, double relevance)
31 : instance_id_(instantiation_count++) { 31 : instance_id_(instantiation_count++) {
32 set_id(id); 32 set_id(id);
33 set_title(base::UTF8ToUTF16(id)); 33 set_title(base::UTF8ToUTF16(id));
34 set_relevance(relevance); 34 set_relevance(relevance);
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 EXPECT_EQ(old_ui_result_ids[0], 383 EXPECT_EQ(old_ui_result_ids[0],
384 TestSearchResult::GetInstanceId(ui_results.GetItemAt(3))); 384 TestSearchResult::GetInstanceId(ui_results.GetItemAt(3)));
385 EXPECT_EQ(old_ui_result_ids[1], 385 EXPECT_EQ(old_ui_result_ids[1],
386 TestSearchResult::GetInstanceId(ui_results.GetItemAt(0))); 386 TestSearchResult::GetInstanceId(ui_results.GetItemAt(0)));
387 EXPECT_EQ(old_ui_result_ids[2], 387 EXPECT_EQ(old_ui_result_ids[2],
388 TestSearchResult::GetInstanceId(ui_results.GetItemAt(2))); 388 TestSearchResult::GetInstanceId(ui_results.GetItemAt(2)));
389 } 389 }
390 390
391 } // namespace test 391 } // namespace test
392 } // namespace app_list 392 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/search/mixer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698