Commit 135a08f3 authored by siyua's avatar siyua Committed by Commit Bot

[Autofill Auth UI]M79-BugFix: verify pending dialog crashes when card

verification completes.

Reason is when verification completes, the
VerifyPendingDialogViewImpl::Hide is called which will reset the controller
and close the dialog. So VerifyPendingDialogViewImpl::Close will be invoked
then VerifyPendingDialogViewImpl::Cancel.

In this case, the controller is already reset when cancel is called, which
will crash.

Bug: 991037
Change-Id: I55e832ae51f4c265c9f166d274b178712cdfffec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900191Reviewed-by: default avatarJared Saul <jsaul@google.com>
Reviewed-by: default avatarManas Verma <manasverma@google.com>
Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Siyu An <siyua@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713101}
parent 49b9e53e
...@@ -70,6 +70,15 @@ IN_PROC_BROWSER_TEST_F(VerifyPendingDialogViewBrowserTest, ...@@ -70,6 +70,15 @@ IN_PROC_BROWSER_TEST_F(VerifyPendingDialogViewBrowserTest,
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
} }
// Ensures dialog can be closed when verification finishes.
IN_PROC_BROWSER_TEST_F(VerifyPendingDialogViewBrowserTest,
VerificationFinishes) {
ShowUi(std::string());
VerifyUi();
GetVerifyPendingDialog()->Hide();
base::RunLoop().RunUntilIdle();
}
// Ensures dialog is closed when cancel button is clicked. // Ensures dialog is closed when cancel button is clicked.
IN_PROC_BROWSER_TEST_F(VerifyPendingDialogViewBrowserTest, ClickCancelButton) { IN_PROC_BROWSER_TEST_F(VerifyPendingDialogViewBrowserTest, ClickCancelButton) {
ShowUi(std::string()); ShowUi(std::string());
......
...@@ -37,6 +37,7 @@ VerifyPendingDialogViewImpl::~VerifyPendingDialogViewImpl() { ...@@ -37,6 +37,7 @@ VerifyPendingDialogViewImpl::~VerifyPendingDialogViewImpl() {
} }
} }
// static
VerifyPendingDialogView* VerifyPendingDialogView::CreateDialogAndShow( VerifyPendingDialogView* VerifyPendingDialogView::CreateDialogAndShow(
VerifyPendingDialogController* controller, VerifyPendingDialogController* controller,
content::WebContents* web_contents) { content::WebContents* web_contents) {
...@@ -59,7 +60,9 @@ void VerifyPendingDialogViewImpl::AddedToWidget() { ...@@ -59,7 +60,9 @@ void VerifyPendingDialogViewImpl::AddedToWidget() {
} }
bool VerifyPendingDialogViewImpl::Cancel() { bool VerifyPendingDialogViewImpl::Cancel() {
controller_->OnCancel(); if (controller_)
controller_->OnCancel();
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment