| 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 286 |
| 287 WebDatabase* web_database_; | 287 WebDatabase* web_database_; |
| 288 AutocompleteSyncableService* autocomplete_syncable_service_; | 288 AutocompleteSyncableService* autocomplete_syncable_service_; |
| 289 AutofillProfileSyncableService* autofill_profile_syncable_service_; | 289 AutofillProfileSyncableService* autofill_profile_syncable_service_; |
| 290 | 290 |
| 291 WaitableEvent syncable_service_created_or_destroyed_; | 291 WaitableEvent syncable_service_created_or_destroyed_; |
| 292 | 292 |
| 293 DISALLOW_COPY_AND_ASSIGN(WebDataServiceFake); | 293 DISALLOW_COPY_AND_ASSIGN(WebDataServiceFake); |
| 294 }; | 294 }; |
| 295 | 295 |
| 296 ProfileKeyedService* BuildMockWebDataServiceWrapper( | 296 BrowserContextKeyedService* BuildMockWebDataServiceWrapper( |
| 297 content::BrowserContext* profile) { | 297 content::BrowserContext* profile) { |
| 298 return new MockWebDataServiceWrapper( | 298 return new MockWebDataServiceWrapper( |
| 299 new TokenWebDataServiceFake(), | 299 new TokenWebDataServiceFake(), |
| 300 new WebDataServiceFake()); | 300 new WebDataServiceFake()); |
| 301 } | 301 } |
| 302 | 302 |
| 303 ACTION_P(MakeAutocompleteSyncComponents, wds) { | 303 ACTION_P(MakeAutocompleteSyncComponents, wds) { |
| 304 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 304 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| 305 if (!BrowserThread::CurrentlyOn(BrowserThread::DB)) | 305 if (!BrowserThread::CurrentlyOn(BrowserThread::DB)) |
| 306 return base::WeakPtr<syncer::SyncableService>(); | 306 return base::WeakPtr<syncer::SyncableService>(); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 MockPersonalDataManager() : PersonalDataManager("en-US") {} | 399 MockPersonalDataManager() : PersonalDataManager("en-US") {} |
| 400 MOCK_CONST_METHOD0(IsDataLoaded, bool()); | 400 MOCK_CONST_METHOD0(IsDataLoaded, bool()); |
| 401 MOCK_METHOD0(LoadProfiles, void()); | 401 MOCK_METHOD0(LoadProfiles, void()); |
| 402 MOCK_METHOD0(LoadCreditCards, void()); | 402 MOCK_METHOD0(LoadCreditCards, void()); |
| 403 MOCK_METHOD0(Refresh, void()); | 403 MOCK_METHOD0(Refresh, void()); |
| 404 }; | 404 }; |
| 405 | 405 |
| 406 class MockPersonalDataManagerService | 406 class MockPersonalDataManagerService |
| 407 : public autofill::PersonalDataManagerService { | 407 : public autofill::PersonalDataManagerService { |
| 408 public: | 408 public: |
| 409 static ProfileKeyedService* Build(content::BrowserContext* profile) { | 409 static BrowserContextKeyedService* Build(content::BrowserContext* profile) { |
| 410 return new MockPersonalDataManagerService(); | 410 return new MockPersonalDataManagerService(); |
| 411 } | 411 } |
| 412 | 412 |
| 413 MockPersonalDataManagerService() { | 413 MockPersonalDataManagerService() { |
| 414 personal_data_manager_.reset(new MockPersonalDataManager()); | 414 personal_data_manager_.reset(new MockPersonalDataManager()); |
| 415 } | 415 } |
| 416 virtual ~MockPersonalDataManagerService() {} | 416 virtual ~MockPersonalDataManagerService() {} |
| 417 | 417 |
| 418 virtual void Shutdown() OVERRIDE { | 418 virtual void Shutdown() OVERRIDE { |
| 419 personal_data_manager_.reset(); | 419 personal_data_manager_.reset(); |
| (...skipping 944 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 |