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

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

Issue 671653002: Standardize usage of virtual/override/final in chrome/browser/ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 "]}"; 159 "]}";
160 160
161 } // namespace 161 } // namespace
162 162
163 class PeopleProviderTest : public InProcessBrowserTest { 163 class PeopleProviderTest : public InProcessBrowserTest {
164 public: 164 public:
165 PeopleProviderTest() {} 165 PeopleProviderTest() {}
166 virtual ~PeopleProviderTest() {} 166 virtual ~PeopleProviderTest() {}
167 167
168 // InProcessBrowserTest overrides: 168 // InProcessBrowserTest overrides:
169 virtual void SetUpOnMainThread() override { 169 void SetUpOnMainThread() override {
170 test_server_.reset(new EmbeddedTestServer); 170 test_server_.reset(new EmbeddedTestServer);
171 171
172 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady()); 172 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady());
173 test_server_->RegisterRequestHandler( 173 test_server_->RegisterRequestHandler(
174 base::Bind(&PeopleProviderTest::HandleRequest, 174 base::Bind(&PeopleProviderTest::HandleRequest,
175 base::Unretained(this))); 175 base::Unretained(this)));
176 176
177 people_provider_.reset(new PeopleProvider( 177 people_provider_.reset(new PeopleProvider(
178 ProfileManager::GetActiveUserProfile(), &test_controller_)); 178 ProfileManager::GetActiveUserProfile(), &test_controller_));
179 179
180 people_provider_->SetupForTest( 180 people_provider_->SetupForTest(
181 base::Bind(&PeopleProviderTest::OnSearchResultsFetched, 181 base::Bind(&PeopleProviderTest::OnSearchResultsFetched,
182 base::Unretained(this)), 182 base::Unretained(this)),
183 test_server_->base_url()); 183 test_server_->base_url());
184 people_provider_->set_use_throttling(false); 184 people_provider_->set_use_throttling(false);
185 } 185 }
186 186
187 virtual void TearDownOnMainThread() override { 187 void TearDownOnMainThread() override {
188 EXPECT_TRUE(test_server_->ShutdownAndWaitUntilComplete()); 188 EXPECT_TRUE(test_server_->ShutdownAndWaitUntilComplete());
189 test_server_.reset(); 189 test_server_.reset();
190 } 190 }
191 191
192 std::string RunQuery(const std::string& query, 192 std::string RunQuery(const std::string& query,
193 const std::string& mock_server_response) { 193 const std::string& mock_server_response) {
194 people_provider_->Start(base::UTF8ToUTF16(query)); 194 people_provider_->Start(base::UTF8ToUTF16(query));
195 195
196 if (people_provider_->people_search_ && !mock_server_response.empty()) { 196 if (people_provider_->people_search_ && !mock_server_response.empty()) {
197 mock_server_response_ = mock_server_response; 197 mock_server_response_ = mock_server_response;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 288 }
289 289
290 IN_PROC_BROWSER_TEST_F(PeopleProviderTest, NoSearchForShortQueries) { 290 IN_PROC_BROWSER_TEST_F(PeopleProviderTest, NoSearchForShortQueries) {
291 EXPECT_EQ("", RunQuery("f", kOneResult)); 291 EXPECT_EQ("", RunQuery("f", kOneResult));
292 EXPECT_EQ("", RunQuery("fi", kOneResult)); 292 EXPECT_EQ("", RunQuery("fi", kOneResult));
293 EXPECT_EQ("first person", RunQuery("fir", kOneResult)); 293 EXPECT_EQ("first person", RunQuery("fir", kOneResult));
294 } 294 }
295 295
296 } // namespace test 296 } // namespace test
297 } // namespace app_list 297 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698