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

Unified Diff: chrome/browser/autofill/autofill_dialog_controller_mac_unittest.mm

Issue 2799054: Remove the AutoFill enable/disable radio from the Options dialog to the AutoFill dialog (Closed)
Patch Set: Created 10 years, 6 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/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
« no previous file with comments | « chrome/browser/autofill/autofill_dialog_controller_mac.mm ('k') | chrome/browser/cocoa/preferences_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698