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

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

Issue 2950473003: Omnibox Test: Fix noisy mock in OmniboxEditTests (Closed)
Patch Set: Created 3 years, 6 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 AutocompleteClassifier::DefaultOmniboxProviders()), 178 AutocompleteClassifier::DefaultOmniboxProviders()),
179 base::MakeUnique<TestingSchemeClassifier>()) {} 179 base::MakeUnique<TestingSchemeClassifier>()) {}
180 180
181 TestingOmniboxClient::~TestingOmniboxClient() { 181 TestingOmniboxClient::~TestingOmniboxClient() {
182 autocomplete_classifier_.Shutdown(); 182 autocomplete_classifier_.Shutdown();
183 } 183 }
184 184
185 std::unique_ptr<AutocompleteProviderClient> 185 std::unique_ptr<AutocompleteProviderClient>
186 TestingOmniboxClient::CreateAutocompleteProviderClient() { 186 TestingOmniboxClient::CreateAutocompleteProviderClient() {
187 std::unique_ptr<MockAutocompleteProviderClient> provider_client( 187 std::unique_ptr<MockAutocompleteProviderClient> provider_client(
188 new MockAutocompleteProviderClient()); 188 new testing::NiceMock<MockAutocompleteProviderClient>());
189 EXPECT_CALL(*provider_client.get(), GetBuiltinURLs()) 189 EXPECT_CALL(*provider_client.get(), GetBuiltinURLs())
190 .WillRepeatedly(testing::Return(std::vector<base::string16>())); 190 .WillRepeatedly(testing::Return(std::vector<base::string16>()));
191 EXPECT_CALL(*provider_client.get(), GetSchemeClassifier()) 191 EXPECT_CALL(*provider_client.get(), GetSchemeClassifier())
192 .WillRepeatedly(testing::ReturnRef(scheme_classifier_)); 192 .WillRepeatedly(testing::ReturnRef(scheme_classifier_));
193 193
194 std::unique_ptr<TemplateURLService> template_url_service( 194 std::unique_ptr<TemplateURLService> template_url_service(
195 new TemplateURLService( 195 new TemplateURLService(
196 nullptr, std::unique_ptr<SearchTermsData>(new SearchTermsData), 196 nullptr, std::unique_ptr<SearchTermsData>(new SearchTermsData),
197 nullptr, std::unique_ptr<TemplateURLServiceClient>(), nullptr, 197 nullptr, std::unique_ptr<TemplateURLServiceClient>(), nullptr,
198 nullptr, base::Closure())); 198 nullptr, base::Closure()));
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 alternate_nav_url, base::string16(), 0); 342 alternate_nav_url, base::string16(), 0);
343 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( 343 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme(
344 client->alternate_nav_match().fill_into_edit)); 344 client->alternate_nav_match().fill_into_edit));
345 345
346 model()->SetUserText(base::ASCIIToUTF16("abcd")); 346 model()->SetUserText(base::ASCIIToUTF16("abcd"));
347 model()->OpenMatch(match, WindowOpenDisposition::CURRENT_TAB, 347 model()->OpenMatch(match, WindowOpenDisposition::CURRENT_TAB,
348 alternate_nav_url, base::string16(), 0); 348 alternate_nav_url, base::string16(), 0);
349 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( 349 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme(
350 client->alternate_nav_match().fill_into_edit)); 350 client->alternate_nav_match().fill_into_edit));
351 } 351 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698