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

Unified Diff: chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc

Issue 1416633010: Fix crash on a page navigation when Update Password bubble is active. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed DCHECK adding Created 5 years, 1 month 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/passwords/manage_passwords_ui_controller.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/passwords/manage_passwords_ui_controller_unittest.cc
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
index 4d49541881380ea1c0fa0f93dafff75d77ce1808..0be4b106d1525adbbc142f40799d5ab5efe99cae 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
@@ -332,7 +332,7 @@ TEST_F(ManagePasswordsUIControllerTest, SlowNavigations) {
controller()->OnPasswordSubmitted(test_form_manager.Pass());
ExpectIconStateIs(password_manager::ui::PENDING_PASSWORD_STATE);
- // Fake-navigate after a second. We expect the bubble's state to be reset
+ // Fake-navigate after 5 seconds. We expect the bubble's state to be reset
// if a navigation occurs after this limit.
controller()->SetElapsed(
base::TimeDelta::FromMilliseconds(kSlowNavigationDelayInMS));
@@ -571,3 +571,20 @@ TEST_F(ManagePasswordsUIControllerTest, PasswordUpdated) {
controller()->UpdatePassword(autofill::PasswordForm());
ExpectIconStateIs(password_manager::ui::MANAGE_STATE);
}
+
+TEST_F(ManagePasswordsUIControllerTest, NavigationWhenUpdateBubbleActive) {
+ scoped_ptr<password_manager::PasswordFormManager> test_form_manager(
+ CreateFormManager());
+ controller()->OnUpdatePasswordSubmitted(test_form_manager.Pass());
+ EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_UPDATE_STATE,
+ controller()->state());
+ // Fake-navigate after 5 seconds. We expect the bubble's state to be reset
+ // if a navigation occurs after this limit.
+ controller()->SetElapsed(
+ base::TimeDelta::FromMilliseconds(kSlowNavigationDelayInMS));
+ controller()->DidNavigateMainFrame(content::LoadCommittedDetails(),
+ content::FrameNavigateParams());
+ EXPECT_EQ(password_manager::ui::INACTIVE_STATE, controller()->state());
+ // The following line shouldn't crash browser.
+ controller()->OnNoInteractionOnUpdate();
+}
« no previous file with comments | « chrome/browser/ui/passwords/manage_passwords_ui_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698