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

Unified Diff: chrome/browser/autofill/content_autofill_driver_browsertest.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/autofill/content_autofill_driver_browsertest.cc
diff --git a/chrome/browser/autofill/content_autofill_driver_browsertest.cc b/chrome/browser/autofill/content_autofill_driver_browsertest.cc
index 1b150949cce74aa37a1803050db6187a41fa4ef5..312a10fe2b31b68b9b58cf094ff8f1b01962e971 100644
--- a/chrome/browser/autofill/content_autofill_driver_browsertest.cc
+++ b/chrome/browser/autofill/content_autofill_driver_browsertest.cc
@@ -11,6 +11,7 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/testing_pref_service_syncable.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_manager.h"
#include "components/autofill/core/browser/test_autofill_client.h"
#include "content/public/browser/navigation_controller.h"
@@ -58,10 +59,10 @@ class MockAutofillClient : public TestAutofillClient {
// instance.
class TestContentAutofillDriver : public ContentAutofillDriver {
public:
- TestContentAutofillDriver(content::WebContents* web_contents,
+ TestContentAutofillDriver(content::RenderFrameHost* rfh,
AutofillClient* client)
: ContentAutofillDriver(
- web_contents,
+ rfh,
client,
g_browser_process->GetApplicationLocale(),
AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER) {}
@@ -86,14 +87,12 @@ class ContentAutofillDriverBrowserTest : public InProcessBrowserTest,
Observe(web_contents);
AutofillManager::RegisterProfilePrefs(autofill_client_.GetPrefRegistry());
- autofill_driver_.reset(
- new TestContentAutofillDriver(web_contents, &autofill_client_));
- }
-
- // Normally the WebContents will automatically delete the driver, but here
- // the driver is owned by this test, so we have to manually destroy.
- virtual void WebContentsDestroyed() override {
- autofill_driver_.reset();
+ web_contents->RemoveUserData(
+ ContentAutofillDriverFactory::
+ kContentAutofillDriverFactoryWebContentsUserDataKey);
+ ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(
+ web_contents, &autofill_client_, "en-US",
+ AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER);
}
virtual void WasHidden() override {
@@ -114,7 +113,6 @@ class ContentAutofillDriverBrowserTest : public InProcessBrowserTest,
base::Closure nav_entry_committed_callback_;
testing::NiceMock<MockAutofillClient> autofill_client_;
- scoped_ptr<TestContentAutofillDriver> autofill_driver_;
};
IN_PROC_BROWSER_TEST_F(ContentAutofillDriverBrowserTest,
« no previous file with comments | « chrome/browser/autofill/autofill_interactive_uitest.cc ('k') | chrome/browser/autofill/form_structure_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698