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

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

Issue 842503002: Merge to branch 2214 [Password Generation] Hide popup if view can not be created. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2214
Patch Set: Created 5 years, 11 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
« no previous file with comments | « chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc
diff --git a/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc b/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc
index 67bcc377e27217a1112380285041d3b7ef7aa1ff..21c74ad0fc54432f6f7f08a484aa7c1b8488743e 100644
--- a/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc
+++ b/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc
@@ -39,13 +39,12 @@ class TestPasswordGenerationPopupController :
class PasswordGenerationPopupViewTest : public InProcessBrowserTest {
public:
- void SetUpOnMainThread() override {
- gfx::NativeView native_view =
- browser()->tab_strip_model()->GetActiveWebContents()->GetNativeView();
+ content::WebContents* GetWebContents() {
+ return browser()->tab_strip_model()->GetActiveWebContents();
+ }
- controller_ =
- new TestPasswordGenerationPopupController(
- browser()->tab_strip_model()->GetActiveWebContents(), native_view);
+ gfx::NativeView GetNativeView() {
+ return GetWebContents()->GetNativeView();
}
scoped_ptr<PasswordGenerationPopupViewTester> GetViewTester() {
@@ -62,6 +61,8 @@ class PasswordGenerationPopupViewTest : public InProcessBrowserTest {
// editing dialog doesn't crash.
IN_PROC_BROWSER_TEST_F(PasswordGenerationPopupViewTest,
MouseMovementInEditingPopup) {
+ controller_ = new autofill::TestPasswordGenerationPopupController(
+ GetWebContents(), GetNativeView());
controller_->Show(false /* display_password */);
gfx::Point center_point =
@@ -72,6 +73,15 @@ IN_PROC_BROWSER_TEST_F(PasswordGenerationPopupViewTest,
// Deletes |controller_|.
controller_->HideAndDestroy();
}
+
+// Verify that we calling Show() with an invalid container does not crash.
+// Regression test for crbug.com/439618.
+IN_PROC_BROWSER_TEST_F(PasswordGenerationPopupViewTest,
+ InvalidContainerView) {
+ controller_ = new autofill::TestPasswordGenerationPopupController(
+ GetWebContents(), NULL);
+ controller_->Show(true /* display password */);
+}
#endif
} // namespace autofill
« no previous file with comments | « chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698