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

Unified Diff: chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc

Issue 16286020: Abstract WebContentsObserver from Autofill shared code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to fix conflict Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
index 7c60bd5601560171ce69a3af51a62373818784f6..fed44236cfd37a1c443b02f86996e6217afa436e 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
@@ -14,6 +14,7 @@
#include "components/autofill/browser/autofill_manager.h"
#include "components/autofill/browser/test_autofill_external_delegate.h"
#include "components/autofill/browser/test_autofill_manager_delegate.h"
+#include "components/autofill/content/browser/autofill_driver_impl.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h"
@@ -156,14 +157,18 @@ class AutofillPopupControllerUnitTest : public ChromeRenderViewHostTestHarness {
virtual void SetUp() OVERRIDE {
ChromeRenderViewHostTestHarness::SetUp();
- AutofillManager::CreateForWebContentsAndDelegate(
+ AutofillDriverImpl::CreateForWebContentsAndDelegate(
web_contents(),
manager_delegate_.get(),
"en-US",
- AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER);
+ AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER,
+ false);
+ AutofillDriverImpl* driver =
+ AutofillDriverImpl::FromWebContents(web_contents());
external_delegate_.reset(
new NiceMock<MockAutofillExternalDelegate>(
- web_contents(), AutofillManager::FromWebContents(web_contents())));
+ web_contents(),
+ driver->autofill_manager()));
autofill_popup_controller_ =
new testing::NiceMock<TestAutofillPopupController>(
@@ -360,8 +365,10 @@ TEST_F(AutofillPopupControllerUnitTest, RowWidthWithoutText) {
}
TEST_F(AutofillPopupControllerUnitTest, GetOrCreate) {
+ AutofillDriverImpl* driver =
+ AutofillDriverImpl::FromWebContents(web_contents());
MockAutofillExternalDelegate delegate(
- web_contents(), AutofillManager::FromWebContents(web_contents()));
+ web_contents(), driver->autofill_manager());
WeakPtr<AutofillPopupControllerImpl> controller =
AutofillPopupControllerImpl::GetOrCreate(
@@ -517,8 +524,10 @@ TEST_F(AutofillPopupControllerUnitTest, GrowPopupInSpace) {
desired_width, desired_height));
for (size_t i = 0; i < element_bounds.size(); ++i) {
+ AutofillDriverImpl* driver =
+ AutofillDriverImpl::FromWebContents(web_contents());
NiceMock<MockAutofillExternalDelegate> external_delegate(
- web_contents(), AutofillManager::FromWebContents(web_contents()));
+ web_contents(), driver->autofill_manager());
TestAutofillPopupController* autofill_popup_controller =
new TestAutofillPopupController(external_delegate.GetWeakPtr(),
element_bounds[i]);
« no previous file with comments | « chrome/browser/ui/autofill/autofill_popup_controller_browsertest.cc ('k') | chrome/browser/ui/browser_tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698