| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 &factory_, &profile_, signin, false, | 221 &factory_, &profile_, signin, false, |
| 222 root_callback, node_callback)); | 222 root_callback, node_callback)); |
| 223 syncable::ModelTypeSet preferred_types = | 223 syncable::ModelTypeSet preferred_types = |
| 224 service_->GetPreferredDataTypes(); | 224 service_->GetPreferredDataTypes(); |
| 225 preferred_types.Put(syncable::PASSWORDS); | 225 preferred_types.Put(syncable::PASSWORDS); |
| 226 service_->ChangePreferredDataTypes(preferred_types); | 226 service_->ChangePreferredDataTypes(preferred_types); |
| 227 EXPECT_CALL(profile_, GetProfileSyncService()).WillRepeatedly( | 227 EXPECT_CALL(profile_, GetProfileSyncService()).WillRepeatedly( |
| 228 Return(service_.get())); | 228 Return(service_.get())); |
| 229 PasswordDataTypeController* data_type_controller = | 229 PasswordDataTypeController* data_type_controller = |
| 230 new PasswordDataTypeController(&factory_, | 230 new PasswordDataTypeController(&factory_, |
| 231 &profile_); | 231 &profile_, |
| 232 service_.get()); |
| 232 | 233 |
| 233 EXPECT_CALL(factory_, CreatePasswordSyncComponents(_, _, _)). | 234 EXPECT_CALL(factory_, CreatePasswordSyncComponents(_, _, _)). |
| 234 Times(AtLeast(1)). // Can be more if we hit NEEDS_CRYPTO. | 235 Times(AtLeast(1)). // Can be more if we hit NEEDS_CRYPTO. |
| 235 WillRepeatedly(MakePasswordSyncComponents(service_.get(), | 236 WillRepeatedly(MakePasswordSyncComponents(service_.get(), |
| 236 password_store_.get(), | 237 password_store_.get(), |
| 237 data_type_controller)); | 238 data_type_controller)); |
| 238 EXPECT_CALL(factory_, CreateDataTypeManager(_, _)). | 239 EXPECT_CALL(factory_, CreateDataTypeManager(_, _)). |
| 239 WillOnce(ReturnNewDataTypeManager()); | 240 WillOnce(ReturnNewDataTypeManager()); |
| 240 | 241 |
| 241 // We need tokens to get the tests going | 242 // We need tokens to get the tests going |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 CreateRootHelper create_root(this, syncable::PASSWORDS); | 614 CreateRootHelper create_root(this, syncable::PASSWORDS); |
| 614 StartSyncService(create_root.callback(), | 615 StartSyncService(create_root.callback(), |
| 615 base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); | 616 base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); |
| 616 | 617 |
| 617 std::vector<PasswordForm> new_sync_forms; | 618 std::vector<PasswordForm> new_sync_forms; |
| 618 GetPasswordEntriesFromSyncDB(&new_sync_forms); | 619 GetPasswordEntriesFromSyncDB(&new_sync_forms); |
| 619 | 620 |
| 620 EXPECT_EQ(1U, new_sync_forms.size()); | 621 EXPECT_EQ(1U, new_sync_forms.size()); |
| 621 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); | 622 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); |
| 622 } | 623 } |
| OLD | NEW |