OLD | NEW |
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 public: | 163 public: |
164 PeopleProviderTest() {} | 164 PeopleProviderTest() {} |
165 virtual ~PeopleProviderTest() {} | 165 virtual ~PeopleProviderTest() {} |
166 | 166 |
167 // InProcessBrowserTest overrides: | 167 // InProcessBrowserTest overrides: |
168 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 168 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
169 command_line->AppendSwitch(switches::kEnablePeopleSearch); | 169 command_line->AppendSwitch(switches::kEnablePeopleSearch); |
170 } | 170 } |
171 | 171 |
172 virtual void SetUpOnMainThread() OVERRIDE { | 172 virtual void SetUpOnMainThread() OVERRIDE { |
173 test_server_.reset(new EmbeddedTestServer( | 173 test_server_.reset(new EmbeddedTestServer); |
174 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); | |
175 | 174 |
176 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady()); | 175 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady()); |
177 test_server_->RegisterRequestHandler( | 176 test_server_->RegisterRequestHandler( |
178 base::Bind(&PeopleProviderTest::HandleRequest, | 177 base::Bind(&PeopleProviderTest::HandleRequest, |
179 base::Unretained(this))); | 178 base::Unretained(this))); |
180 | 179 |
181 people_provider_.reset(new PeopleProvider( | 180 people_provider_.reset(new PeopleProvider( |
182 ProfileManager::GetDefaultProfile())); | 181 ProfileManager::GetDefaultProfile())); |
183 | 182 |
184 people_provider_->SetupForTest( | 183 people_provider_->SetupForTest( |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 } | 290 } |
292 | 291 |
293 IN_PROC_BROWSER_TEST_F(PeopleProviderTest, NoSearchForShortQueries) { | 292 IN_PROC_BROWSER_TEST_F(PeopleProviderTest, NoSearchForShortQueries) { |
294 EXPECT_EQ("", RunQuery("f", kOneResult)); | 293 EXPECT_EQ("", RunQuery("f", kOneResult)); |
295 EXPECT_EQ("", RunQuery("fi", kOneResult)); | 294 EXPECT_EQ("", RunQuery("fi", kOneResult)); |
296 EXPECT_EQ("first person", RunQuery("fir", kOneResult)); | 295 EXPECT_EQ("first person", RunQuery("fir", kOneResult)); |
297 } | 296 } |
298 | 297 |
299 } // namespace test | 298 } // namespace test |
300 } // namespace app_list | 299 } // namespace app_list |
OLD | NEW |