| 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 "components/autofill/core/browser/autofill_data_model.h" | 5 #include "components/autofill/core/browser/autofill_data_model.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace autofill { | 10 namespace autofill { |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 // Provides concrete implementations for pure virtual methods. | 14 // Provides concrete implementations for pure virtual methods. |
| 15 class TestAutofillDataModel : public AutofillDataModel { | 15 class TestAutofillDataModel : public AutofillDataModel { |
| 16 public: | 16 public: |
| 17 TestAutofillDataModel(const std::string& guid, const std::string& origin) | 17 TestAutofillDataModel(const std::string& guid, const std::string& origin) |
| 18 : AutofillDataModel(guid, origin) {} | 18 : AutofillDataModel(guid, origin) {} |
| 19 virtual ~TestAutofillDataModel() {} | 19 ~TestAutofillDataModel() override {} |
| 20 | 20 |
| 21 private: | 21 private: |
| 22 virtual base::string16 GetRawInfo(ServerFieldType type) const override { | 22 base::string16 GetRawInfo(ServerFieldType type) const override { |
| 23 return base::string16(); | 23 return base::string16(); |
| 24 } | 24 } |
| 25 virtual void SetRawInfo(ServerFieldType type, | 25 void SetRawInfo(ServerFieldType type, const base::string16& value) override {} |
| 26 const base::string16& value) override {} | 26 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override {} |
| 27 virtual void GetSupportedTypes( | |
| 28 ServerFieldTypeSet* supported_types) const override {} | |
| 29 | 27 |
| 30 DISALLOW_COPY_AND_ASSIGN(TestAutofillDataModel); | 28 DISALLOW_COPY_AND_ASSIGN(TestAutofillDataModel); |
| 31 }; | 29 }; |
| 32 | 30 |
| 33 } // namespace | 31 } // namespace |
| 34 | 32 |
| 35 TEST(AutofillDataModelTest, IsVerified) { | 33 TEST(AutofillDataModelTest, IsVerified) { |
| 36 TestAutofillDataModel model("guid", std::string()); | 34 TestAutofillDataModel model("guid", std::string()); |
| 37 EXPECT_FALSE(model.IsVerified()); | 35 EXPECT_FALSE(model.IsVerified()); |
| 38 | 36 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 55 EXPECT_TRUE(model.IsVerified()); | 53 EXPECT_TRUE(model.IsVerified()); |
| 56 | 54 |
| 57 model.set_origin("Some gibberish string"); | 55 model.set_origin("Some gibberish string"); |
| 58 EXPECT_TRUE(model.IsVerified()); | 56 EXPECT_TRUE(model.IsVerified()); |
| 59 | 57 |
| 60 model.set_origin(std::string()); | 58 model.set_origin(std::string()); |
| 61 EXPECT_FALSE(model.IsVerified()); | 59 EXPECT_FALSE(model.IsVerified()); |
| 62 } | 60 } |
| 63 | 61 |
| 64 } // namespace autofill | 62 } // namespace autofill |
| OLD | NEW |