Commit b77443e6 authored by sreejakshetty@chromium.org's avatar sreejakshetty@chromium.org Committed by Commit Bot

Test: HideFillingUI is called on navigating away

This CL adds a test to check whether
ChromePasswordManagerClient::HideFillingUI
was called on navigating away.

Here
https://chromium-review.googlesource.com/c/chromium/src/+/1995173 we
added the functionality.


Change-Id: I8b99f879ab73fe63280c276b3db682eddfb9fa89
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2056547
Commit-Queue: Sreeja Kamishetty <sreejakshetty@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742565}
parent cacf63e9
...@@ -773,6 +773,14 @@ class ChromePasswordManagerClientAndroidTest ...@@ -773,6 +773,14 @@ class ChromePasswordManagerClientAndroidTest
void CreateManualFillingController(content::WebContents* web_contents); void CreateManualFillingController(content::WebContents* web_contents);
ManualFillingControllerImpl* controller() {
return ManualFillingControllerImpl::FromWebContents(web_contents());
}
MockManualFillingView* view() {
return static_cast<MockManualFillingView*>(controller()->view());
}
private: private:
autofill::TestAutofillClient test_autofill_client_; autofill::TestAutofillClient test_autofill_client_;
NiceMock<MockPasswordAccessoryController> mock_pwd_controller_; NiceMock<MockPasswordAccessoryController> mock_pwd_controller_;
...@@ -908,4 +916,16 @@ TEST_F(ChromePasswordManagerClientAndroidTest, ...@@ -908,4 +916,16 @@ TEST_F(ChromePasswordManagerClientAndroidTest,
.empty()); .empty());
} }
TEST_F(ChromePasswordManagerClientAndroidTest, HideFillingUIOnNavigatingAway) {
CreateManualFillingController(web_contents());
// Navigate to a URL with a bubble/popup.
GURL kUrl1("https://example.com/");
NavigateAndCommit(kUrl1);
EXPECT_TRUE(ChromePasswordManagerClient::CanShowBubbleOnURL(kUrl1));
// Navigating away should call Hide.
EXPECT_CALL(*view(), Hide());
GURL kUrl2("https://accounts.google.com");
NavigateAndCommit(kUrl2);
}
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
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