| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "components/autofill/content/browser/wallet/gaia_account.h" | 10 #include "components/autofill/content/browser/wallet/gaia_account.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } // anonymous namespace | 386 } // anonymous namespace |
| 387 | 387 |
| 388 namespace autofill { | 388 namespace autofill { |
| 389 namespace wallet { | 389 namespace wallet { |
| 390 | 390 |
| 391 class WalletItemsTest : public testing::Test { | 391 class WalletItemsTest : public testing::Test { |
| 392 public: | 392 public: |
| 393 WalletItemsTest() {} | 393 WalletItemsTest() {} |
| 394 protected: | 394 protected: |
| 395 void SetUpDictionary(const std::string& json) { | 395 void SetUpDictionary(const std::string& json) { |
| 396 scoped_ptr<Value> value(base::JSONReader::Read(json)); | 396 scoped_ptr<base::Value> value(base::JSONReader::Read(json)); |
| 397 ASSERT_TRUE(value.get()); | 397 ASSERT_TRUE(value.get()); |
| 398 ASSERT_TRUE(value->IsType(Value::TYPE_DICTIONARY)); | 398 ASSERT_TRUE(value->IsType(base::Value::TYPE_DICTIONARY)); |
| 399 dict.reset(static_cast<DictionaryValue*>(value.release())); | 399 dict.reset(static_cast<base::DictionaryValue*>(value.release())); |
| 400 } | 400 } |
| 401 scoped_ptr<DictionaryValue> dict; | 401 scoped_ptr<base::DictionaryValue> dict; |
| 402 }; | 402 }; |
| 403 | 403 |
| 404 TEST_F(WalletItemsTest, CreateMaskedInstrumentMissingStatus) { | 404 TEST_F(WalletItemsTest, CreateMaskedInstrumentMissingStatus) { |
| 405 SetUpDictionary(kMaskedInstrumentMissingStatus); | 405 SetUpDictionary(kMaskedInstrumentMissingStatus); |
| 406 EXPECT_EQ(NULL, | 406 EXPECT_EQ(NULL, |
| 407 WalletItems::MaskedInstrument::CreateMaskedInstrument(*dict).get()); | 407 WalletItems::MaskedInstrument::CreateMaskedInstrument(*dict).get()); |
| 408 } | 408 } |
| 409 | 409 |
| 410 TEST_F(WalletItemsTest, CreateMaskedInstrumentMissingType) { | 410 TEST_F(WalletItemsTest, CreateMaskedInstrumentMissingType) { |
| 411 SetUpDictionary(kMaskedInstrumentMissingType); | 411 SetUpDictionary(kMaskedInstrumentMissingType); |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 ASCIIToUTF16("display_name"))); | 611 ASCIIToUTF16("display_name"))); |
| 612 expected.AddLegalDocument(legal_document.Pass()); | 612 expected.AddLegalDocument(legal_document.Pass()); |
| 613 expected.AddLegalDocument( | 613 expected.AddLegalDocument( |
| 614 WalletItems::LegalDocument::CreatePrivacyPolicyDocument()); | 614 WalletItems::LegalDocument::CreatePrivacyPolicyDocument()); |
| 615 | 615 |
| 616 EXPECT_EQ(expected, *WalletItems::CreateWalletItems(*dict)); | 616 EXPECT_EQ(expected, *WalletItems::CreateWalletItems(*dict)); |
| 617 } | 617 } |
| 618 | 618 |
| 619 } // namespace wallet | 619 } // namespace wallet |
| 620 } // namespace autofill | 620 } // namespace autofill |
| OLD | NEW |