| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 template<> | 154 template<> |
| 155 syncer::ModelType GetModelType<AutofillEntry>() { | 155 syncer::ModelType GetModelType<AutofillEntry>() { |
| 156 return syncer::AUTOFILL; | 156 return syncer::AUTOFILL; |
| 157 } | 157 } |
| 158 | 158 |
| 159 template<> | 159 template<> |
| 160 syncer::ModelType GetModelType<AutofillProfile>() { | 160 syncer::ModelType GetModelType<AutofillProfile>() { |
| 161 return syncer::AUTOFILL_PROFILE; | 161 return syncer::AUTOFILL_PROFILE; |
| 162 } | 162 } |
| 163 | 163 |
| 164 class TokenWebDataServiceFake : public WebDataService { | 164 class TokenWebDataServiceFake : public TokenWebData { |
| 165 public: | 165 public: |
| 166 TokenWebDataServiceFake() | 166 TokenWebDataServiceFake() |
| 167 : WebDataService() { | 167 : TokenWebData() { |
| 168 } | 168 } |
| 169 | 169 |
| 170 virtual bool IsDatabaseLoaded() OVERRIDE { | 170 virtual bool IsDatabaseLoaded() OVERRIDE { |
| 171 return true; | 171 return true; |
| 172 } | 172 } |
| 173 | 173 |
| 174 virtual WebDataService::Handle GetAllTokens( | 174 virtual WebDataService::Handle GetAllTokens( |
| 175 WebDataServiceConsumer* consumer) OVERRIDE { | 175 WebDataServiceConsumer* consumer) OVERRIDE { |
| 176 // TODO(tim): It would be nice if WebDataService was injected on | 176 // TODO(tim): It would be nice if WebDataService was injected on |
| 177 // construction of TokenService rather than fetched by Initialize so that | 177 // construction of TokenService rather than fetched by Initialize so that |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1364 std::vector<AutofillEntry> sync_entries; | 1364 std::vector<AutofillEntry> sync_entries; |
| 1365 std::vector<AutofillProfile> sync_profiles; | 1365 std::vector<AutofillProfile> sync_profiles; |
| 1366 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1366 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
| 1367 EXPECT_EQ(3U, sync_entries.size()); | 1367 EXPECT_EQ(3U, sync_entries.size()); |
| 1368 EXPECT_EQ(0U, sync_profiles.size()); | 1368 EXPECT_EQ(0U, sync_profiles.size()); |
| 1369 for (size_t i = 0; i < sync_entries.size(); i++) { | 1369 for (size_t i = 0; i < sync_entries.size(); i++) { |
| 1370 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1370 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
| 1371 << ", " << sync_entries[i].key().value(); | 1371 << ", " << sync_entries[i].key().value(); |
| 1372 } | 1372 } |
| 1373 } | 1373 } |
| OLD | NEW |