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

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

Issue 707173004: Refactor Autofill for out of process iframes (OOPIF). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mem leak Created 6 years 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 fef22bea0c5f15cc2a3d1d93b02f01db5fab1145..9265f0a170ecd087b254ec1b3a41c317690a8dbe 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_unittest.cc
@@ -13,12 +13,14 @@
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "components/autofill/content/browser/content_autofill_driver.h"
+#include "components/autofill/content/browser/content_autofill_driver_factory.h"
#include "components/autofill/core/browser/autofill_external_delegate.h"
#include "components/autofill/core/browser/autofill_manager.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/popup_item_ids.h"
#include "components/autofill/core/browser/test_autofill_client.h"
#include "components/autofill/core/browser/test_autofill_external_delegate.h"
+#include "content/public/browser/web_contents.h"
#include "grit/components_scaled_resources.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -129,13 +131,13 @@ class AutofillPopupControllerUnitTest : public ChromeRenderViewHostTestHarness {
void SetUp() override {
ChromeRenderViewHostTestHarness::SetUp();
- ContentAutofillDriver::CreateForWebContentsAndDelegate(
- web_contents(),
- autofill_client_.get(),
- "en-US",
+ ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(
+ web_contents(), autofill_client_.get(), "en-US",
AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER);
+ ContentAutofillDriverFactory* factory =
+ ContentAutofillDriverFactory::FromWebContents(web_contents());
ContentAutofillDriver* driver =
- ContentAutofillDriver::FromWebContents(web_contents());
+ factory->DriverForFrame(web_contents()->GetMainFrame());
external_delegate_.reset(
new NiceMock<MockAutofillExternalDelegate>(
driver->autofill_manager(),
@@ -425,8 +427,10 @@ TEST_F(AutofillPopupControllerUnitTest, PopupsWithOnlyDataLists) {
}
TEST_F(AutofillPopupControllerUnitTest, GetOrCreate) {
+ ContentAutofillDriverFactory* factory =
+ ContentAutofillDriverFactory::FromWebContents(web_contents());
ContentAutofillDriver* driver =
- ContentAutofillDriver::FromWebContents(web_contents());
+ factory->DriverForFrame(web_contents()->GetMainFrame());
MockAutofillExternalDelegate delegate(driver->autofill_manager(), driver);
WeakPtr<AutofillPopupControllerImpl> controller =

Powered by Google App Engine
This is Rietveld 408576698