| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 EXPECT_CALL(observer_, | 191 EXPECT_CALL(observer_, |
| 192 Observe( | 192 Observe( |
| 193 NotificationType(NotificationType::SYNC_PASSPHRASE_ACCEPTED), | 193 NotificationType(NotificationType::SYNC_PASSPHRASE_ACCEPTED), |
| 194 _,_)). | 194 _,_)). |
| 195 WillOnce(InvokeTask(node_task)); | 195 WillOnce(InvokeTask(node_task)); |
| 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 WillOnce(QuitUIMessageLoop()); | 200 WillOnce(QuitUIMessageLoop()); |
| 201 service_->SetPassphrase("foo", false); | 201 service_->SetPassphrase("foo", false, true); |
| 202 MessageLoop::current()->Run(); | 202 MessageLoop::current()->Run(); |
| 203 } | 203 } |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 | 206 |
| 207 void AddPasswordSyncNode(const PasswordForm& entry) { | 207 void AddPasswordSyncNode(const PasswordForm& entry) { |
| 208 sync_api::WriteTransaction trans( | 208 sync_api::WriteTransaction trans( |
| 209 service_->backend()->GetUserShareHandle()); | 209 service_->backend()->GetUserShareHandle()); |
| 210 sync_api::ReadNode password_root(&trans); | 210 sync_api::ReadNode password_root(&trans); |
| 211 ASSERT_TRUE(password_root.InitByTagLookup(browser_sync::kPasswordTag)); | 211 ASSERT_TRUE(password_root.InitByTagLookup(browser_sync::kPasswordTag)); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 AddPasswordEntriesTask node_task(this, sync_forms); | 534 AddPasswordEntriesTask node_task(this, sync_forms); |
| 535 | 535 |
| 536 StartSyncService(&root_task, &node_task); | 536 StartSyncService(&root_task, &node_task); |
| 537 | 537 |
| 538 std::vector<PasswordForm> new_sync_forms; | 538 std::vector<PasswordForm> new_sync_forms; |
| 539 GetPasswordEntriesFromSyncDB(&new_sync_forms); | 539 GetPasswordEntriesFromSyncDB(&new_sync_forms); |
| 540 | 540 |
| 541 EXPECT_EQ(1U, new_sync_forms.size()); | 541 EXPECT_EQ(1U, new_sync_forms.size()); |
| 542 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); | 542 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); |
| 543 } | 543 } |
| OLD | NEW |