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

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

Issue 23874015: Implement people search. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
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 <string> 5 #include <string>
6 6
7 #include "base/memory/scoped_vector.h" 7 #include "base/memory/scoped_vector.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 MixerTest() {} 77 MixerTest() {}
78 virtual ~MixerTest() {} 78 virtual ~MixerTest() {}
79 79
80 // testing::Test overrides: 80 // testing::Test overrides:
81 virtual void SetUp() OVERRIDE { 81 virtual void SetUp() OVERRIDE {
82 results_.reset(new AppListModel::SearchResults); 82 results_.reset(new AppListModel::SearchResults);
83 83
84 providers_.push_back(new TestSearchProvider("app")); 84 providers_.push_back(new TestSearchProvider("app"));
85 providers_.push_back(new TestSearchProvider("omnibox")); 85 providers_.push_back(new TestSearchProvider("omnibox"));
86 providers_.push_back(new TestSearchProvider("webstore")); 86 providers_.push_back(new TestSearchProvider("webstore"));
87 providers_.push_back(new TestSearchProvider("people"));
87 88
88 mixer_.reset(new Mixer(results_.get())); 89 mixer_.reset(new Mixer(results_.get()));
89 mixer_->Init(); 90 mixer_->Init();
90 mixer_->AddProviderToGroup(Mixer::MAIN_GROUP, providers_[0]); 91 mixer_->AddProviderToGroup(Mixer::MAIN_GROUP, providers_[0]);
91 mixer_->AddProviderToGroup(Mixer::OMNIBOX_GROUP, providers_[1]); 92 mixer_->AddProviderToGroup(Mixer::OMNIBOX_GROUP, providers_[1]);
92 mixer_->AddProviderToGroup(Mixer::WEBSTORE_GROUP, providers_[2]); 93 mixer_->AddProviderToGroup(Mixer::WEBSTORE_GROUP, providers_[2]);
94 mixer_->AddProviderToGroup(Mixer::PEOPLE_GROUP, providers_[3]);
93 } 95 }
94 96
95 void RunQuery() { 97 void RunQuery() {
96 const string16 query; 98 const string16 query;
97 99
98 for (size_t i = 0; i < providers_.size(); ++i) { 100 for (size_t i = 0; i < providers_.size(); ++i) {
99 providers_[i]->Start(query); 101 providers_[i]->Start(query);
100 providers_[i]->Stop(); 102 providers_[i]->Stop();
101 } 103 }
102 104
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 webstore_provider()->set_count(1); 178 webstore_provider()->set_count(1);
177 179
178 RunQuery(); 180 RunQuery();
179 181
180 // Only three results with unique id are kept. 182 // Only three results with unique id are kept.
181 EXPECT_EQ("dup0,dup1,dup2", GetResults()); 183 EXPECT_EQ("dup0,dup1,dup2", GetResults());
182 } 184 }
183 185
184 } // namespace test 186 } // namespace test
185 } // namespace app_list 187 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698