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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 WillOnce(ReturnNewDataTypeManager()); | 182 WillOnce(ReturnNewDataTypeManager()); |
183 | 183 |
184 // We need tokens to get the tests going | 184 // We need tokens to get the tests going |
185 token_service_.IssueAuthTokenForTest( | 185 token_service_.IssueAuthTokenForTest( |
186 GaiaConstants::kSyncService, "token"); | 186 GaiaConstants::kSyncService, "token"); |
187 | 187 |
188 EXPECT_CALL(profile_, GetTokenService()). | 188 EXPECT_CALL(profile_, GetTokenService()). |
189 WillRepeatedly(Return(&token_service_)); | 189 WillRepeatedly(Return(&token_service_)); |
190 | 190 |
191 EXPECT_CALL(profile_, GetPasswordStore(_)). | 191 EXPECT_CALL(profile_, GetPasswordStore(_)). |
192 Times(2). | 192 Times(3). |
193 WillRepeatedly(Return(password_store_.get())); | 193 WillRepeatedly(Return(password_store_.get())); |
194 | 194 |
195 EXPECT_CALL(observer_, | 195 EXPECT_CALL(observer_, |
196 Observe( | 196 Observe( |
197 NotificationType(NotificationType::SYNC_CONFIGURE_DONE),_,_)); | 197 NotificationType(NotificationType::SYNC_CONFIGURE_DONE),_,_)); |
198 | 198 |
199 service_->RegisterDataTypeController(data_type_controller); | 199 service_->RegisterDataTypeController(data_type_controller); |
200 service_->Initialize(); | 200 service_->Initialize(); |
201 MessageLoop::current()->Run(); | 201 MessageLoop::current()->Run(); |
202 | 202 |
(...skipping 319 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 |