OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/task.h" | 9 #include "base/task.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 WillOnce(ReturnNewDataTypeManager()); | 183 WillOnce(ReturnNewDataTypeManager()); |
184 | 184 |
185 // We need tokens to get the tests going | 185 // We need tokens to get the tests going |
186 token_service_.IssueAuthTokenForTest( | 186 token_service_.IssueAuthTokenForTest( |
187 GaiaConstants::kSyncService, "token"); | 187 GaiaConstants::kSyncService, "token"); |
188 | 188 |
189 EXPECT_CALL(profile_, GetTokenService()). | 189 EXPECT_CALL(profile_, GetTokenService()). |
190 WillRepeatedly(Return(&token_service_)); | 190 WillRepeatedly(Return(&token_service_)); |
191 | 191 |
192 EXPECT_CALL(profile_, GetPasswordStore(_)). | 192 EXPECT_CALL(profile_, GetPasswordStore(_)). |
193 Times(2). | 193 Times(3). |
194 WillRepeatedly(Return(password_store_.get())); | 194 WillRepeatedly(Return(password_store_.get())); |
195 | 195 |
196 EXPECT_CALL(observer_, | 196 EXPECT_CALL(observer_, |
197 Observe( | 197 Observe( |
198 NotificationType(NotificationType::SYNC_CONFIGURE_DONE),_,_)); | 198 NotificationType(NotificationType::SYNC_CONFIGURE_DONE),_,_)); |
199 | 199 |
200 service_->RegisterDataTypeController(data_type_controller); | 200 service_->RegisterDataTypeController(data_type_controller); |
201 service_->Initialize(); | 201 service_->Initialize(); |
202 MessageLoop::current()->Run(); | 202 MessageLoop::current()->Run(); |
203 | 203 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 AddPasswordEntriesTask node_task(this, sync_forms); | 522 AddPasswordEntriesTask node_task(this, sync_forms); |
523 | 523 |
524 StartSyncService(&root_task, &node_task); | 524 StartSyncService(&root_task, &node_task); |
525 | 525 |
526 std::vector<PasswordForm> new_sync_forms; | 526 std::vector<PasswordForm> new_sync_forms; |
527 GetPasswordEntriesFromSyncDB(&new_sync_forms); | 527 GetPasswordEntriesFromSyncDB(&new_sync_forms); |
528 | 528 |
529 EXPECT_EQ(1U, new_sync_forms.size()); | 529 EXPECT_EQ(1U, new_sync_forms.size()); |
530 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); | 530 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); |
531 } | 531 } |
OLD | NEW |