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

Side by Side Diff: components/autofill/browser/autocomplete_history_manager_unittest.cc

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 years, 8 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 | Annotate | Revision Log
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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/prefs/testing_pref_service.h" 8 #include "base/prefs/testing_pref_service.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 private: 55 private:
56 // Keep track of the most recently created instance, so that it can be 56 // Keep track of the most recently created instance, so that it can be
57 // associated with the current profile when Build() is called. 57 // associated with the current profile when Build() is called.
58 static MockWebDataService* current_mock_web_data_service_; 58 static MockWebDataService* current_mock_web_data_service_;
59 }; 59 };
60 60
61 MockWebDataService* MockWebDataService::current_mock_web_data_service_ = NULL; 61 MockWebDataService* MockWebDataService::current_mock_web_data_service_ = NULL;
62 62
63 class MockWebDataServiceWrapperCurrent : public MockWebDataServiceWrapperBase { 63 class MockWebDataServiceWrapperCurrent : public MockWebDataServiceWrapperBase {
64 public: 64 public:
65 static ProfileKeyedService* Build(Profile* profile) { 65 static ProfileKeyedService* Build(content::BrowserContext* profile) {
66 return new MockWebDataServiceWrapperCurrent(); 66 return new MockWebDataServiceWrapperCurrent();
67 } 67 }
68 68
69 MockWebDataServiceWrapperCurrent() {} 69 MockWebDataServiceWrapperCurrent() {}
70 70
71 virtual scoped_refptr<AutofillWebDataService> GetAutofillWebData() OVERRIDE { 71 virtual scoped_refptr<AutofillWebDataService> GetAutofillWebData() OVERRIDE {
72 return MockWebDataService::GetCurrent(); 72 return MockWebDataService::GetCurrent();
73 } 73 }
74 74
75 private: 75 private:
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 MockAutofillExternalDelegate external_delegate(web_contents()); 257 MockAutofillExternalDelegate external_delegate(web_contents());
258 autocomplete_history_manager.SetExternalDelegate(&external_delegate); 258 autocomplete_history_manager.SetExternalDelegate(&external_delegate);
259 259
260 // Should trigger a call to OnSuggestionsReturned, verified by the mock. 260 // Should trigger a call to OnSuggestionsReturned, verified by the mock.
261 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _)); 261 EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _, _, _));
262 autocomplete_history_manager.SendSuggestions(NULL); 262 autocomplete_history_manager.SendSuggestions(NULL);
263 } 263 }
264 264
265 } // namespace autofill 265 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698