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

Side by Side Diff: chrome/browser/autocomplete/search_provider_unittest.cc

Issue 645303003: Parametrize Suggest polling strategy and delay. Also add a parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed two comments. 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
« no previous file with comments | « no previous file | chrome/browser/ui/search/instant_extended_interactive_uitest.cc » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "components/omnibox/search_provider.h" 5 #include "components/omnibox/search_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 315
316 // Keywords are updated by the InMemoryHistoryBackend only after the message 316 // Keywords are updated by the InMemoryHistoryBackend only after the message
317 // has been processed on the history thread. Block until history processes all 317 // has been processed on the history thread. Block until history processes all
318 // requests to ensure the InMemoryDatabase is the state we expect it. 318 // requests to ensure the InMemoryDatabase is the state we expect it.
319 profile_.BlockUntilHistoryProcessesPendingRequests(); 319 profile_.BlockUntilHistoryProcessesPendingRequests();
320 320
321 AutocompleteClassifierFactory::GetInstance()->SetTestingFactoryAndUse( 321 AutocompleteClassifierFactory::GetInstance()->SetTestingFactoryAndUse(
322 &profile_, &AutocompleteClassifierFactory::BuildInstanceFor); 322 &profile_, &AutocompleteClassifierFactory::BuildInstanceFor);
323 323
324 provider_ = new SearchProviderForTest(this, turl_model, &profile_); 324 provider_ = new SearchProviderForTest(this, turl_model, &profile_);
325 provider_->kMinimumTimeBetweenSuggestQueriesMs = 0; 325 OmniboxFieldTrial::kDefaultMinimumTimeBetweenSuggestQueriesMs = 0;
326 } 326 }
327 327
328 void SearchProviderTest::TearDown() { 328 void SearchProviderTest::TearDown() {
329 base::RunLoop().RunUntilIdle(); 329 base::RunLoop().RunUntilIdle();
330 330
331 // Shutdown the provider before the profile. 331 // Shutdown the provider before the profile.
332 provider_ = NULL; 332 provider_ = NULL;
333 } 333 }
334 334
335 void SearchProviderTest::RunTest(TestData* cases, 335 void SearchProviderTest::RunTest(TestData* cases,
(...skipping 3112 matching lines...) Expand 10 before | Expand all | Expand 10 after
3448 EXPECT_EQ(base::ASCIIToUTF16("42"), matches[0].answer_type); 3448 EXPECT_EQ(base::ASCIIToUTF16("42"), matches[0].answer_type);
3449 EXPECT_TRUE(matches[1].answer_contents.empty()); 3449 EXPECT_TRUE(matches[1].answer_contents.empty());
3450 EXPECT_TRUE(matches[1].answer_type.empty()); 3450 EXPECT_TRUE(matches[1].answer_type.empty());
3451 EXPECT_TRUE(matches[2].answer_contents.empty()); 3451 EXPECT_TRUE(matches[2].answer_contents.empty());
3452 EXPECT_TRUE(matches[2].answer_type.empty()); 3452 EXPECT_TRUE(matches[2].answer_type.empty());
3453 EXPECT_TRUE(matches[3].answer_contents.empty()); 3453 EXPECT_TRUE(matches[3].answer_contents.empty());
3454 EXPECT_TRUE(matches[3].answer_type.empty()); 3454 EXPECT_TRUE(matches[3].answer_type.empty());
3455 EXPECT_TRUE(matches[4].answer_contents.empty()); 3455 EXPECT_TRUE(matches[4].answer_contents.empty());
3456 EXPECT_TRUE(matches[4].answer_type.empty()); 3456 EXPECT_TRUE(matches[4].answer_type.empty());
3457 } 3457 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/search/instant_extended_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698