Chromium Code Reviews| 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/browser/search_provider.h" | 5 #include "components/omnibox/browser/search_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 501 SCOPED_TRACE(" Case # " + base::SizeTToString(i)); | 501 SCOPED_TRACE(" Case # " + base::SizeTToString(i)); |
| 502 EXPECT_EQ(kNotApplicable, expected_matches[i].contents); | 502 EXPECT_EQ(kNotApplicable, expected_matches[i].contents); |
| 503 } | 503 } |
| 504 } | 504 } |
| 505 | 505 |
| 506 void SearchProviderTest::ResetFieldTrialList() { | 506 void SearchProviderTest::ResetFieldTrialList() { |
| 507 // Destroy the existing FieldTrialList before creating a new one to avoid | 507 // Destroy the existing FieldTrialList before creating a new one to avoid |
| 508 // a DCHECK. | 508 // a DCHECK. |
| 509 field_trial_list_.reset(); | 509 field_trial_list_.reset(); |
| 510 field_trial_list_.reset(new base::FieldTrialList( | 510 field_trial_list_.reset(new base::FieldTrialList( |
| 511 new metrics::SHA1EntropyProvider("foo"))); | 511 base::MakeUnique<metrics::SHA1EntropyProvider>("foo"))); |
|
Alexei Svitkine (slow)
2016/09/21 15:52:00
Nit: Actually all the test code that currently pas
robliao
2016/09/21 17:24:29
I haven't done an analysis of the tests to verify
| |
| 512 variations::testing::ClearAllVariationParams(); | 512 variations::testing::ClearAllVariationParams(); |
| 513 } | 513 } |
| 514 | 514 |
| 515 base::FieldTrial* SearchProviderTest::CreateFieldTrial( | 515 base::FieldTrial* SearchProviderTest::CreateFieldTrial( |
| 516 const char* field_trial_rule, | 516 const char* field_trial_rule, |
| 517 bool enabled) { | 517 bool enabled) { |
| 518 std::map<std::string, std::string> params; | 518 std::map<std::string, std::string> params; |
| 519 params[std::string(field_trial_rule)] = enabled ? | 519 params[std::string(field_trial_rule)] = enabled ? |
| 520 "true" : "false"; | 520 "true" : "false"; |
| 521 variations::AssociateVariationParams( | 521 variations::AssociateVariationParams( |
| (...skipping 2992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3514 } | 3514 } |
| 3515 | 3515 |
| 3516 TEST_F(SearchProviderTest, DoesNotProvideOnFocus) { | 3516 TEST_F(SearchProviderTest, DoesNotProvideOnFocus) { |
| 3517 AutocompleteInput input( | 3517 AutocompleteInput input( |
| 3518 base::ASCIIToUTF16("f"), base::string16::npos, std::string(), GURL(), | 3518 base::ASCIIToUTF16("f"), base::string16::npos, std::string(), GURL(), |
| 3519 metrics::OmniboxEventProto::INVALID_SPEC, false, true, true, true, true, | 3519 metrics::OmniboxEventProto::INVALID_SPEC, false, true, true, true, true, |
| 3520 ChromeAutocompleteSchemeClassifier(&profile_)); | 3520 ChromeAutocompleteSchemeClassifier(&profile_)); |
| 3521 provider_->Start(input, false); | 3521 provider_->Start(input, false); |
| 3522 EXPECT_TRUE(provider_->matches().empty()); | 3522 EXPECT_TRUE(provider_->matches().empty()); |
| 3523 } | 3523 } |
| OLD | NEW |