| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 s.BindString16(1, value); | 108 s.BindString16(1, value); |
| 109 s.Step(); | 109 s.Step(); |
| 110 return s.ColumnInt(0); | 110 return s.ColumnInt(0); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace | 113 } // namespace |
| 114 | 114 |
| 115 class AutofillTableTest : public testing::Test { | 115 class AutofillTableTest : public testing::Test { |
| 116 public: | 116 public: |
| 117 AutofillTableTest() {} | 117 AutofillTableTest() {} |
| 118 virtual ~AutofillTableTest() {} | 118 ~AutofillTableTest() override {} |
| 119 | 119 |
| 120 protected: | 120 protected: |
| 121 virtual void SetUp() { | 121 void SetUp() override { |
| 122 #if defined(OS_MACOSX) | 122 #if defined(OS_MACOSX) |
| 123 OSCrypt::UseMockKeychain(true); | 123 OSCrypt::UseMockKeychain(true); |
| 124 #endif | 124 #endif |
| 125 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 125 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 126 file_ = temp_dir_.path().AppendASCII("TestWebDatabase"); | 126 file_ = temp_dir_.path().AppendASCII("TestWebDatabase"); |
| 127 | 127 |
| 128 table_.reset(new AutofillTable("en-US")); | 128 table_.reset(new AutofillTable("en-US")); |
| 129 db_.reset(new WebDatabase); | 129 db_.reset(new WebDatabase); |
| 130 db_->AddTable(table_.get()); | 130 db_->AddTable(table_.get()); |
| 131 ASSERT_EQ(sql::INIT_OK, db_->Init(file_)); | 131 ASSERT_EQ(sql::INIT_OK, db_->Init(file_)); |
| (...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 | 1599 |
| 1600 std::vector<AutofillEntry> entries; | 1600 std::vector<AutofillEntry> entries; |
| 1601 ASSERT_TRUE(table_->GetAllAutofillEntries(&entries)); | 1601 ASSERT_TRUE(table_->GetAllAutofillEntries(&entries)); |
| 1602 AutofillEntrySet entry_set(entries.begin(), entries.end(), | 1602 AutofillEntrySet entry_set(entries.begin(), entries.end(), |
| 1603 CompareAutofillEntries); | 1603 CompareAutofillEntries); |
| 1604 | 1604 |
| 1605 CompareAutofillEntrySets(entry_set, expected_entries); | 1605 CompareAutofillEntrySets(entry_set, expected_entries); |
| 1606 } | 1606 } |
| 1607 | 1607 |
| 1608 } // namespace autofill | 1608 } // namespace autofill |
| OLD | NEW |