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

Unified Diff: chrome/browser/autofill/autocomplete_history_manager_unittest.cc

Issue 10908065: Introduce a couple of abstract bases for WebDataService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autofill/autocomplete_history_manager_unittest.cc
diff --git a/chrome/browser/autofill/autocomplete_history_manager_unittest.cc b/chrome/browser/autofill/autocomplete_history_manager_unittest.cc
index 61634cb3fbc52a9f60ad26747ef781e4fffa9135..16799f9840eb1ed65001248359bb9afd0b1468de 100644
--- a/chrome/browser/autofill/autocomplete_history_manager_unittest.cc
+++ b/chrome/browser/autofill/autocomplete_history_manager_unittest.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/autofill/autocomplete_history_manager.h"
#include "chrome/browser/autofill/test_autofill_external_delegate.h"
#include "chrome/browser/ui/tab_contents/tab_contents.h"
+#include "chrome/browser/webdata/autofill_web_data_service_impl.h"
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_browser_process.h"
@@ -44,8 +45,12 @@ class AutocompleteHistoryManagerTest : public ChromeRenderViewHostTestHarness {
virtual void SetUp() {
ChromeRenderViewHostTestHarness::SetUp();
web_data_service_ = new MockWebDataService();
- autocomplete_manager_.reset(new AutocompleteHistoryManager(
- contents(), &profile_, web_data_service_));
+ autocomplete_manager_.reset(
+ new AutocompleteHistoryManager(
+ contents(),
+ &profile_,
+ scoped_ptr<AutofillWebDataService>(
erikwright (departed) 2012/09/13 01:45:11 make_scoped_ptr would save the explicit template p
Jói 2012/09/13 12:34:50 The type needs to be exactly scoped_ptr<AutofillWe
+ new AutofillWebDataServiceImpl(web_data_service_))));
}
content::TestBrowserThread ui_thread_;
@@ -168,10 +173,11 @@ class MockAutofillExternalDelegate : public TestAutofillExternalDelegate {
class AutocompleteHistoryManagerStubSend : public AutocompleteHistoryManager {
public:
- explicit AutocompleteHistoryManagerStubSend(WebContents* web_contents,
- Profile* profile,
- WebDataService* wds)
- : AutocompleteHistoryManager(web_contents, profile, wds) {}
+ explicit AutocompleteHistoryManagerStubSend(
+ WebContents* web_contents,
+ Profile* profile,
+ scoped_ptr<AutofillWebDataService> wds)
+ : AutocompleteHistoryManager(web_contents, profile, wds.Pass()) {}
// Intentionally swallow the message.
virtual bool Send(IPC::Message* message) { delete message; return true; }
@@ -184,7 +190,9 @@ TEST_F(AutocompleteHistoryManagerTest, ExternalDelegate) {
// Local version with a stubbed out Send()
AutocompleteHistoryManagerStubSend autocomplete_history_manager(
contents(),
- &profile_, web_data_service_);
+ &profile_,
+ scoped_ptr<AutofillWebDataService>(
+ new AutofillWebDataServiceImpl(web_data_service_)));
MockAutofillExternalDelegate external_delegate(
TabContents::FromWebContents(contents()));

Powered by Google App Engine
This is Rietveld 408576698