OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/location.h" | 5 #include "base/location.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/browser/autofill/autofill_profile.h" | 7 #include "chrome/browser/autofill/autofill_profile.h" |
8 #include "chrome/browser/sync/internal_api/read_node_mock.h" | 8 #include "chrome/browser/sync/internal_api/read_node_mock.h" |
9 #include "chrome/browser/sync/internal_api/syncapi_mock.h" | 9 #include "chrome/browser/sync/internal_api/syncapi_mock.h" |
10 #include "chrome/browser/sync/syncable/syncable.h" | 10 #include "chrome/browser/sync/syncable/syncable.h" |
11 #include "chrome/browser/sync/syncable/syncable_mock.h" | 11 #include "chrome/browser/sync/syncable/syncable_mock.h" |
12 #include "chrome/browser/webdata/autofill_change.h" | 12 #include "chrome/browser/webdata/autofill_change.h" |
13 #include "chrome/browser/webdata/autofill_profile_syncable_service.h" | 13 #include "chrome/browser/webdata/autofill_profile_syncable_service.h" |
14 #include "content/test/test_browser_thread.h" | 14 #include "content/test/test_browser_thread.h" |
15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 using ::testing::_; | 18 using ::testing::_; |
19 using ::testing::DoAll; | 19 using ::testing::DoAll; |
20 using ::testing::Eq; | 20 using ::testing::Eq; |
21 using ::testing::Return; | 21 using ::testing::Return; |
22 using ::testing::Property; | 22 using ::testing::Property; |
| 23 using content::BrowserThread; |
23 class AutofillProfile; | 24 class AutofillProfile; |
24 | 25 |
25 class MockAutofillProfileSyncableService | 26 class MockAutofillProfileSyncableService |
26 : public AutofillProfileSyncableService { | 27 : public AutofillProfileSyncableService { |
27 public: | 28 public: |
28 MockAutofillProfileSyncableService() { | 29 MockAutofillProfileSyncableService() { |
29 } | 30 } |
30 virtual ~MockAutofillProfileSyncableService() {} | 31 virtual ~MockAutofillProfileSyncableService() {} |
31 | 32 |
32 MOCK_METHOD1(LoadAutofillData, bool(std::vector<AutofillProfile*>*)); | 33 MOCK_METHOD1(LoadAutofillData, bool(std::vector<AutofillProfile*>*)); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 AutofillProfileChange change1(AutofillProfileChange::ADD, guid1, &profile); | 251 AutofillProfileChange change1(AutofillProfileChange::ADD, guid1, &profile); |
251 AutofillProfileChange change2(AutofillProfileChange::REMOVE, guid2, NULL); | 252 AutofillProfileChange change2(AutofillProfileChange::REMOVE, guid2, NULL); |
252 ON_CALL(*sync_processor_, ProcessSyncChanges(_, _)) | 253 ON_CALL(*sync_processor_, ProcessSyncChanges(_, _)) |
253 .WillByDefault(Return(SyncError(FROM_HERE, std::string("an error"), | 254 .WillByDefault(Return(SyncError(FROM_HERE, std::string("an error"), |
254 syncable::AUTOFILL_PROFILE))); | 255 syncable::AUTOFILL_PROFILE))); |
255 | 256 |
256 autofill_syncable_service_.set_sync_processor(sync_processor_.get()); | 257 autofill_syncable_service_.set_sync_processor(sync_processor_.get()); |
257 autofill_syncable_service_.ActOnChange(change1); | 258 autofill_syncable_service_.ActOnChange(change1); |
258 autofill_syncable_service_.ActOnChange(change2); | 259 autofill_syncable_service_.ActOnChange(change2); |
259 } | 260 } |
OLD | NEW |