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

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

Issue 2878050: AutoFill credit card settings dialog should display obfuscated number in edit field (Closed)
Patch Set: Created 10 years, 5 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 96276e4c0d9e5497f457d04410f37e3c24265887..ac6833d175698f822b9dff6629257487813e0e3e 100644
--- a/chrome/browser/autofill/autofill_dialog_controller_mac_unittest.mm
+++ b/chrome/browser/autofill/autofill_dialog_controller_mac_unittest.mm
@@ -313,12 +313,18 @@ TEST_F(AutoFillDialogControllerTest, CreditCardDataMutation) {
EXPECT_TRUE([[cm expirationMonth] isEqualToString:@"01"]);
EXPECT_TRUE([[cm expirationYear] isEqualToString:@"2012"]);
+ // Check that user-visible text is obfuscated.
+ NSTextField* numberField = [sheet creditCardNumberField];
+ ASSERT_TRUE(numberField != nil);
+ EXPECT_TRUE([[numberField stringValue] isEqualToString:@"************1121"]);
+
[sheet save:nil];
[controller_ save:nil];
ASSERT_TRUE(observer_.hit_);
ASSERT_TRUE(observer_.credit_cards_.size() == 1);
+ // Don't compare unique ids.
credit_cards()[0]->set_unique_id(observer_.credit_cards_[0].unique_id());
ASSERT_EQ(observer_.credit_cards_[0], *credit_cards()[0]);
}

Powered by Google App Engine
This is Rietveld 408576698