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

Side by Side Diff: components/omnibox/browser/autocomplete_result_unittest.cc

Issue 2358723002: Convert FieldTrialList to Accept a std::unique_ptr (Closed)
Patch Set: Change Comment nullptr to null Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/autocomplete_result.h" 5 #include "components/omnibox/browser/autocomplete_result.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 // Duplicate matches. 96 // Duplicate matches.
97 std::vector<AutocompleteMatch> duplicate_matches; 97 std::vector<AutocompleteMatch> duplicate_matches;
98 }; 98 };
99 99
100 AutocompleteResultTest() { 100 AutocompleteResultTest() {
101 // Destroy the existing FieldTrialList before creating a new one to avoid 101 // Destroy the existing FieldTrialList before creating a new one to avoid
102 // a DCHECK. 102 // a DCHECK.
103 field_trial_list_.reset(); 103 field_trial_list_.reset();
104 field_trial_list_.reset(new base::FieldTrialList( 104 field_trial_list_.reset(new base::FieldTrialList(
105 new metrics::SHA1EntropyProvider("foo"))); 105 base::MakeUnique<metrics::SHA1EntropyProvider>("foo")));
106 variations::testing::ClearAllVariationParams(); 106 variations::testing::ClearAllVariationParams();
107 107
108 // Create the list of mock providers. 5 is enough. 108 // Create the list of mock providers. 5 is enough.
109 for (size_t i = 0; i < 5; ++i) { 109 for (size_t i = 0; i < 5; ++i) {
110 mock_provider_list_.push_back(new MockAutocompleteProvider( 110 mock_provider_list_.push_back(new MockAutocompleteProvider(
111 static_cast<AutocompleteProvider::Type>(i))); 111 static_cast<AutocompleteProvider::Type>(i)));
112 } 112 }
113 } 113 }
114 114
115 void SetUp() override { 115 void SetUp() override {
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 matches.clear(); 665 matches.clear();
666 666
667 // Case 4: Standalone verbatim match found in AutocompleteResult. 667 // Case 4: Standalone verbatim match found in AutocompleteResult.
668 PopulateAutocompleteMatchesFromTestData(kVerbatimMatches, 1, &matches); 668 PopulateAutocompleteMatchesFromTestData(kVerbatimMatches, 1, &matches);
669 PopulateAutocompleteMatchesFromTestData(kNonVerbatimMatches, 1, &matches); 669 PopulateAutocompleteMatchesFromTestData(kNonVerbatimMatches, 1, &matches);
670 result.AppendMatches(AutocompleteInput(), matches); 670 result.AppendMatches(AutocompleteInput(), matches);
671 EXPECT_TRUE(result.TopMatchIsStandaloneVerbatimMatch()); 671 EXPECT_TRUE(result.TopMatchIsStandaloneVerbatimMatch());
672 result.Reset(); 672 result.Reset();
673 matches.clear(); 673 matches.clear();
674 } 674 }
OLDNEW
« no previous file with comments | « components/network_time/network_time_tracker_unittest.cc ('k') | components/omnibox/browser/keyword_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698