| Index: chrome/browser/autofill/autofill_dialog_controller_mac_unittest.mm
|
| diff --git a/chrome/browser/autofill/autofill_dialog_controller_mac_unittest.mm b/chrome/browser/autofill/autofill_dialog_controller_mac_unittest.mm
|
| index 1fc4373cdc0b2e5d75ff4fb3fa97d3235f2d3372..e0bc14cdd322ff1a150a57230b4d65a6ffbb14ca 100644
|
| --- a/chrome/browser/autofill/autofill_dialog_controller_mac_unittest.mm
|
| +++ b/chrome/browser/autofill/autofill_dialog_controller_mac_unittest.mm
|
| @@ -598,4 +598,45 @@ TEST_F(AutoFillDialogControllerTest, ImportedParameters) {
|
| ASSERT_EQ(observer_.credit_cards_[0], credit_card);
|
| }
|
|
|
| +// AutoFill is enabled by default.
|
| +TEST_F(AutoFillDialogControllerTest, AutoFillEnabledTrue) {
|
| + LoadDialog();
|
| + [controller_ save:nil];
|
| +
|
| + // Should hit our observer.
|
| + ASSERT_TRUE(observer_.hit_);
|
| +
|
| + // AutoFill enabled setting should be unchanged.
|
| + ASSERT_TRUE(helper_.profile()->GetPrefs()->GetBoolean(
|
| + prefs::kAutoFillEnabled));
|
| +}
|
| +
|
| +TEST_F(AutoFillDialogControllerTest, AutoFillEnabledFalse) {
|
| + helper_.profile()->GetPrefs()->SetBoolean(prefs::kAutoFillEnabled, false);
|
| + LoadDialog();
|
| + [controller_ save:nil];
|
| +
|
| + // Should hit our observer.
|
| + ASSERT_TRUE(observer_.hit_);
|
| +
|
| + // AutoFill enabled setting should be unchanged.
|
| + ASSERT_FALSE(helper_.profile()->GetPrefs()->GetBoolean(
|
| + prefs::kAutoFillEnabled));
|
| +}
|
| +
|
| +TEST_F(AutoFillDialogControllerTest, AutoFillEnabledChanged) {
|
| + helper_.profile()->GetPrefs()->SetBoolean(
|
| + prefs::kAutoFillAuxiliaryProfilesEnabled, false);
|
| + LoadDialog();
|
| + [controller_ setAutoFillEnabled:YES];
|
| + [controller_ save:nil];
|
| +
|
| + // Should hit our observer.
|
| + ASSERT_TRUE(observer_.hit_);
|
| +
|
| + // Auxiliary profiles setting should be unchanged.
|
| + ASSERT_TRUE(helper_.profile()->GetPrefs()->GetBoolean(
|
| + prefs::kAutoFillEnabled));
|
| +}
|
| +
|
| } // namespace
|
|
|