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

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

Issue 811563004: [Password Generation] Hide popup if view can not be created. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« 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 7789f67fcfab17563197da1cbb5c119a64070ada..55eab63bdf320010e80f44c669e3c9f2a3d2ab14 100644
--- a/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc
+++ b/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc
@@ -40,13 +40,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() {
@@ -63,6 +62,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 =
@@ -73,6 +74,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