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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 EXPECT_CALL(factory_, CreateDataTypeManager(_, _)). | 159 EXPECT_CALL(factory_, CreateDataTypeManager(_, _)). |
160 WillOnce(ReturnNewDataTypeManager()); | 160 WillOnce(ReturnNewDataTypeManager()); |
161 | 161 |
162 // We need tokens to get the tests going | 162 // We need tokens to get the tests going |
163 token_service_.IssueAuthTokenForTest( | 163 token_service_.IssueAuthTokenForTest( |
164 GaiaConstants::kSyncService, "token"); | 164 GaiaConstants::kSyncService, "token"); |
165 | 165 |
166 EXPECT_CALL(profile_, GetTokenService()). | 166 EXPECT_CALL(profile_, GetTokenService()). |
167 WillRepeatedly(Return(&token_service_)); | 167 WillRepeatedly(Return(&token_service_)); |
168 | 168 |
169 // Creating model safe workers will request the history service and | |
170 // password store. I couldn't manage to convince gmock that splitting up | |
171 // the expectations to match the class responsibilities was a good thing, | |
172 // so we set them all together here. | |
173 EXPECT_CALL(profile_, GetHistoryService(_)). | |
174 WillOnce(Return(static_cast<HistoryService*>(NULL))); | |
175 | |
176 EXPECT_CALL(profile_, GetPasswordStore(_)). | 169 EXPECT_CALL(profile_, GetPasswordStore(_)). |
177 Times(2). | 170 Times(2). |
178 WillRepeatedly(Return(password_store_.get())); | 171 WillRepeatedly(Return(password_store_.get())); |
179 | 172 |
180 EXPECT_CALL(observer_, | 173 EXPECT_CALL(observer_, |
181 Observe( | 174 Observe( |
182 NotificationType(NotificationType::SYNC_CONFIGURE_DONE),_,_)); | 175 NotificationType(NotificationType::SYNC_CONFIGURE_DONE),_,_)); |
183 | 176 |
184 service_->RegisterDataTypeController(data_type_controller); | 177 service_->RegisterDataTypeController(data_type_controller); |
185 service_->Initialize(); | 178 service_->Initialize(); |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 AddPasswordEntriesTask node_task(this, sync_forms); | 527 AddPasswordEntriesTask node_task(this, sync_forms); |
535 | 528 |
536 StartSyncService(&root_task, &node_task); | 529 StartSyncService(&root_task, &node_task); |
537 | 530 |
538 std::vector<PasswordForm> new_sync_forms; | 531 std::vector<PasswordForm> new_sync_forms; |
539 GetPasswordEntriesFromSyncDB(&new_sync_forms); | 532 GetPasswordEntriesFromSyncDB(&new_sync_forms); |
540 | 533 |
541 EXPECT_EQ(1U, new_sync_forms.size()); | 534 EXPECT_EQ(1U, new_sync_forms.size()); |
542 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); | 535 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); |
543 } | 536 } |
OLD | NEW |