Index: chrome/browser/ui/autofill/autofill_dialog_models_unittest.cc |
diff --git a/chrome/browser/ui/autofill/autofill_dialog_models_unittest.cc b/chrome/browser/ui/autofill/autofill_dialog_models_unittest.cc |
index f361db1208e5ee88e758b269ae7d03ea54de034a..99ef33fca718ba5c8e28fe61770367649923724b 100644 |
--- a/chrome/browser/ui/autofill/autofill_dialog_models_unittest.cc |
+++ b/chrome/browser/ui/autofill/autofill_dialog_models_unittest.cc |
@@ -11,81 +11,4 @@ |
namespace autofill { |
-namespace { |
- |
-class MockAccountChooserModelDelegate : public AccountChooserModelDelegate { |
- public: |
- MockAccountChooserModelDelegate() {} |
- virtual ~MockAccountChooserModelDelegate() {} |
- |
- MOCK_METHOD0(AccountChoiceChanged, void()); |
-}; |
- |
-class AccountChooserModelTest : public testing::Test { |
- public: |
- AccountChooserModelTest() : model_(&delegate_, profile_.GetPrefs()) {} |
- virtual ~AccountChooserModelTest() {} |
- |
- Profile* profile() { return &profile_; } |
- MockAccountChooserModelDelegate* delegate() { return &delegate_; } |
- AccountChooserModel* model() { return &model_; } |
- |
- private: |
- TestingProfile profile_; |
- MockAccountChooserModelDelegate delegate_; |
- AccountChooserModel model_; |
-}; |
- |
-} // namespace |
- |
-TEST_F(AccountChooserModelTest, ObeysPref) { |
- EXPECT_CALL(*delegate(), AccountChoiceChanged()).Times(2); |
- |
- profile()->GetPrefs()->SetBoolean( |
- prefs::kAutofillDialogPayWithoutWallet, false); |
- EXPECT_TRUE(model()->WalletIsSelected()); |
- |
- profile()->GetPrefs()->SetBoolean( |
- prefs::kAutofillDialogPayWithoutWallet, true); |
- EXPECT_FALSE(model()->WalletIsSelected()); |
-} |
- |
-TEST_F(AccountChooserModelTest, HandlesError) { |
- EXPECT_CALL(*delegate(), AccountChoiceChanged()).Times(2); |
- |
- profile()->GetPrefs()->SetBoolean( |
- prefs::kAutofillDialogPayWithoutWallet, false); |
- EXPECT_TRUE(model()->WalletIsSelected()); |
- |
- model()->SetHadWalletError(); |
- EXPECT_FALSE(model()->WalletIsSelected()); |
- EXPECT_FALSE(model()->IsCommandIdEnabled(0)); |
-} |
- |
-TEST_F(AccountChooserModelTest, HandlesSigninError) { |
- EXPECT_CALL(*delegate(), AccountChoiceChanged()).Times(2); |
- |
- profile()->GetPrefs()->SetBoolean( |
- prefs::kAutofillDialogPayWithoutWallet, false); |
- EXPECT_TRUE(model()->WalletIsSelected()); |
- |
- model()->SetHadWalletSigninError(); |
- EXPECT_FALSE(model()->WalletIsSelected()); |
- EXPECT_TRUE(model()->IsCommandIdEnabled(0)); |
-} |
- |
-TEST_F(AccountChooserModelTest, RespectsUserChoice) { |
- EXPECT_CALL(*delegate(), AccountChoiceChanged()).Times(3); |
- |
- profile()->GetPrefs()->SetBoolean( |
- prefs::kAutofillDialogPayWithoutWallet, false); |
- EXPECT_TRUE(model()->WalletIsSelected()); |
- |
- model()->ExecuteCommand(1, 0); |
- EXPECT_FALSE(model()->WalletIsSelected()); |
- |
- model()->ExecuteCommand(0, 0); |
- EXPECT_TRUE(model()->WalletIsSelected()); |
-} |
- |
} // namespace autofill |