OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/browser/sync/glue/password_change_processor.h" | 25 #include "chrome/browser/sync/glue/password_change_processor.h" |
26 #include "chrome/browser/sync/glue/password_data_type_controller.h" | 26 #include "chrome/browser/sync/glue/password_data_type_controller.h" |
27 #include "chrome/browser/sync/glue/password_model_associator.h" | 27 #include "chrome/browser/sync/glue/password_model_associator.h" |
28 #include "chrome/browser/sync/profile_sync_components_factory.h" | 28 #include "chrome/browser/sync/profile_sync_components_factory.h" |
29 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" | 29 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" |
30 #include "chrome/browser/sync/profile_sync_service.h" | 30 #include "chrome/browser/sync/profile_sync_service.h" |
31 #include "chrome/browser/sync/profile_sync_service_factory.h" | 31 #include "chrome/browser/sync/profile_sync_service_factory.h" |
32 #include "chrome/browser/sync/profile_sync_test_util.h" | 32 #include "chrome/browser/sync/profile_sync_test_util.h" |
33 #include "chrome/browser/sync/test_profile_sync_service.h" | 33 #include "chrome/browser/sync/test_profile_sync_service.h" |
34 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
| 35 #include "components/autofill/core/common/password_form.h" |
35 #include "content/public/browser/notification_source.h" | 36 #include "content/public/browser/notification_source.h" |
36 #include "content/public/common/password_form.h" | |
37 #include "content/public/test/mock_notification_observer.h" | 37 #include "content/public/test/mock_notification_observer.h" |
38 #include "content/public/test/test_browser_thread.h" | 38 #include "content/public/test/test_browser_thread.h" |
39 #include "google_apis/gaia/gaia_constants.h" | 39 #include "google_apis/gaia/gaia_constants.h" |
40 #include "sync/internal_api/public/read_node.h" | 40 #include "sync/internal_api/public/read_node.h" |
41 #include "sync/internal_api/public/read_transaction.h" | 41 #include "sync/internal_api/public/read_transaction.h" |
42 #include "sync/internal_api/public/write_node.h" | 42 #include "sync/internal_api/public/write_node.h" |
43 #include "sync/internal_api/public/write_transaction.h" | 43 #include "sync/internal_api/public/write_transaction.h" |
44 #include "sync/protocol/password_specifics.pb.h" | 44 #include "sync/protocol/password_specifics.pb.h" |
45 #include "sync/test/engine/test_id_factory.h" | 45 #include "sync/test/engine/test_id_factory.h" |
46 #include "testing/gmock/include/gmock/gmock.h" | 46 #include "testing/gmock/include/gmock/gmock.h" |
47 | 47 |
| 48 using autofill::PasswordForm; |
48 using base::Time; | 49 using base::Time; |
49 using browser_sync::PasswordChangeProcessor; | 50 using browser_sync::PasswordChangeProcessor; |
50 using browser_sync::PasswordDataTypeController; | 51 using browser_sync::PasswordDataTypeController; |
51 using browser_sync::PasswordModelAssociator; | 52 using browser_sync::PasswordModelAssociator; |
52 using content::BrowserThread; | 53 using content::BrowserThread; |
53 using content::PasswordForm; | |
54 using syncer::syncable::WriteTransaction; | 54 using syncer::syncable::WriteTransaction; |
55 using testing::_; | 55 using testing::_; |
56 using testing::AtLeast; | 56 using testing::AtLeast; |
57 using testing::DoAll; | 57 using testing::DoAll; |
58 using testing::InvokeWithoutArgs; | 58 using testing::InvokeWithoutArgs; |
59 using testing::Return; | 59 using testing::Return; |
60 using testing::SetArgumentPointee; | 60 using testing::SetArgumentPointee; |
61 | 61 |
62 ACTION_P3(MakePasswordSyncComponents, service, ps, dtc) { | 62 ACTION_P3(MakePasswordSyncComponents, service, ps, dtc) { |
63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 CreateRootHelper create_root(this, syncer::PASSWORDS); | 648 CreateRootHelper create_root(this, syncer::PASSWORDS); |
649 StartSyncService(create_root.callback(), | 649 StartSyncService(create_root.callback(), |
650 base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); | 650 base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); |
651 | 651 |
652 std::vector<PasswordForm> new_sync_forms; | 652 std::vector<PasswordForm> new_sync_forms; |
653 GetPasswordEntriesFromSyncDB(&new_sync_forms); | 653 GetPasswordEntriesFromSyncDB(&new_sync_forms); |
654 | 654 |
655 EXPECT_EQ(1U, new_sync_forms.size()); | 655 EXPECT_EQ(1U, new_sync_forms.size()); |
656 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); | 656 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); |
657 } | 657 } |
OLD | NEW |