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

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

Issue 13331007: Multi-account AccountChooser for interactive autocomplete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
Index: chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
index f6e98b6adc9653e734c08d9be540a727074a5b62..a0d45b35e11c2ad9f0b1fc0053911199f5ae7cf5 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
@@ -280,9 +280,10 @@ class AutofillDialogControllerTest : public testing::Test {
}
void SetUpWallet() {
- controller()->MenuModelForAccountChooser()->ActivatedAt(
- AccountChooserModel::kWalletItemId);
controller()->OnUserNameFetchSuccess("user@example.com");
+ ui::MenuModel* account_model = controller()->MenuModelForAccountChooser();
+ ASSERT_TRUE(account_model);
+ account_model->ActivatedAt(AccountChooserModel::kActiveWalletItemId);
}
TestAutofillDialogController* controller() { return controller_; }
@@ -629,7 +630,7 @@ TEST_F(AutofillDialogControllerTest, ChangeAccountDuringSubmit) {
ui::MenuModel* account_menu = controller()->MenuModelForAccountChooser();
ASSERT_TRUE(account_menu);
ASSERT_GE(2, account_menu->GetItemCount());
- account_menu->ActivatedAt(AccountChooserModel::kWalletItemId);
+ account_menu->ActivatedAt(AccountChooserModel::kActiveWalletItemId);
account_menu->ActivatedAt(AccountChooserModel::kAutofillItemId);
EXPECT_TRUE(controller()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK));
@@ -678,7 +679,7 @@ TEST_F(AutofillDialogControllerTest, ChangeAccountDuringVerifyCvv) {
ui::MenuModel* account_menu = controller()->MenuModelForAccountChooser();
ASSERT_TRUE(account_menu);
ASSERT_GE(2, account_menu->GetItemCount());
- account_menu->ActivatedAt(AccountChooserModel::kWalletItemId);
+ account_menu->ActivatedAt(AccountChooserModel::kActiveWalletItemId);
account_menu->ActivatedAt(AccountChooserModel::kAutofillItemId);
EXPECT_TRUE(controller()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK));
@@ -725,12 +726,13 @@ TEST_F(AutofillDialogControllerTest, WalletDetailsExplanation) {
// Switch to using Autofill, no explanatory message should show.
ui::MenuModel* account_menu = controller()->MenuModelForAccountChooser();
+ ASSERT_TRUE(account_menu);
account_menu->ActivatedAt(AccountChooserModel::kAutofillItemId);
EXPECT_TRUE(NotificationsOfType(
DialogNotification::EXPLANATORY_MESSAGE).empty());
// Switch to Wallet, pretend this isn't first run. No message should show.
- account_menu->ActivatedAt(AccountChooserModel::kWalletItemId);
+ account_menu->ActivatedAt(AccountChooserModel::kActiveWalletItemId);
controller()->set_is_first_run(false);
EXPECT_TRUE(NotificationsOfType(
DialogNotification::EXPLANATORY_MESSAGE).empty());
@@ -761,6 +763,7 @@ TEST_F(AutofillDialogControllerTest, SaveDetailsInWallet) {
// Using Autofill on second run, show an interactive, unchecked checkbox.
ui::MenuModel* account_model = controller()->MenuModelForAccountChooser();
+ ASSERT_TRUE(account_model);
account_model->ActivatedAt(AccountChooserModel::kAutofillItemId);
controller()->set_is_first_run(false);
@@ -771,7 +774,7 @@ TEST_F(AutofillDialogControllerTest, SaveDetailsInWallet) {
EXPECT_TRUE(notifications.front().interactive());
// Notifications shouldn't be interactive while submitting.
- account_model->ActivatedAt(AccountChooserModel::kWalletItemId);
+ account_model->ActivatedAt(AccountChooserModel::kActiveWalletItemId);
controller()->OnAccept();
EXPECT_FALSE(NotificationsOfType(
DialogNotification::WALLET_USAGE_CONFIRMATION).front().interactive());

Powered by Google App Engine
This is Rietveld 408576698