| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |