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

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

Issue 6621076: [Mac] Remove native/Cocoa preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase switch removal Created 9 years, 9 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_credit_card_model_mac_unittest.mm
diff --git a/chrome/browser/autofill/autofill_credit_card_model_mac_unittest.mm b/chrome/browser/autofill/autofill_credit_card_model_mac_unittest.mm
deleted file mode 100644
index ad7a7e26630527245435763464163152154473b0..0000000000000000000000000000000000000000
--- a/chrome/browser/autofill/autofill_credit_card_model_mac_unittest.mm
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/scoped_nsobject.h"
-#include "base/utf_string_conversions.h"
-#include "chrome/browser/autofill/autofill_common_test.h"
-#import "chrome/browser/autofill/autofill_credit_card_model_mac.h"
-#include "chrome/browser/autofill/credit_card.h"
-#include "chrome/browser/ui/cocoa/browser_test_helper.h"
-#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-typedef CocoaTest AutoFillCreditCardModelTest;
-
-TEST(AutoFillCreditCardModelTest, Basic) {
- // A basic test that creates a new instance and releases.
- // Aids valgrind leak detection.
- CreditCard credit_card;
- scoped_nsobject<AutoFillCreditCardModel> model(
- [[AutoFillCreditCardModel alloc] initWithCreditCard:credit_card]);
- EXPECT_TRUE(model.get());
-}
-
-TEST(AutoFillCreditCardModelTest, InitializationFromCreditCard) {
- CreditCard credit_card;
- autofill_test::SetCreditCardInfo(&credit_card,
- "John Dillinger", "123456789012", "01", "2010");
- scoped_nsobject<AutoFillCreditCardModel> model(
- [[AutoFillCreditCardModel alloc] initWithCreditCard:credit_card]);
- EXPECT_TRUE(model.get());
-
- EXPECT_TRUE([[model nameOnCard] isEqualToString:@"John Dillinger"]);
- EXPECT_TRUE([[model creditCardNumber] isEqualToString:@"123456789012"]);
- EXPECT_TRUE([[model expirationMonth] isEqualToString:@"01"]);
- EXPECT_TRUE([[model expirationYear] isEqualToString:@"2010"]);
-}
-
-TEST(AutoFillCreditCardModelTest, CopyModelToCreditCard) {
- CreditCard credit_card;
- autofill_test::SetCreditCardInfo(&credit_card,
- "John Dillinger", "123456789012", "01", "2010");
- scoped_nsobject<AutoFillCreditCardModel> model(
- [[AutoFillCreditCardModel alloc] initWithCreditCard:credit_card]);
- EXPECT_TRUE(model.get());
-
- [model setNameOnCard:@"John DillingerX"];
- [model setCreditCardNumber:@"223456789012"];
- [model setExpirationMonth:@"11"];
- [model setExpirationYear:@"2011"];
-
- [model copyModelToCreditCard:&credit_card];
-
- EXPECT_EQ(ASCIIToUTF16("John DillingerX"),
- credit_card.GetFieldText(AutofillType(CREDIT_CARD_NAME)));
- EXPECT_EQ(ASCIIToUTF16("223456789012"),
- credit_card.GetFieldText(AutofillType(CREDIT_CARD_NUMBER)));
- EXPECT_EQ(ASCIIToUTF16("11"),
- credit_card.GetFieldText(AutofillType(CREDIT_CARD_EXP_MONTH)));
- EXPECT_EQ(ASCIIToUTF16("2011"),
- credit_card.GetFieldText(
- AutofillType(CREDIT_CARD_EXP_4_DIGIT_YEAR)));
-}
-
-} // namespace

Powered by Google App Engine
This is Rietveld 408576698