| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 Observe( | 230 Observe( |
| 231 int( | 231 int( |
| 232 chrome::NOTIFICATION_SYNC_CONFIGURE_BLOCKED),_,_)) | 232 chrome::NOTIFICATION_SYNC_CONFIGURE_BLOCKED),_,_)) |
| 233 .WillOnce(InvokeWithoutArgs(QuitMessageLoop)); | 233 .WillOnce(InvokeWithoutArgs(QuitMessageLoop)); |
| 234 | 234 |
| 235 service_->RegisterDataTypeController(data_type_controller); | 235 service_->RegisterDataTypeController(data_type_controller); |
| 236 service_->Initialize(); | 236 service_->Initialize(); |
| 237 MessageLoop::current()->Run(); | 237 MessageLoop::current()->Run(); |
| 238 FlushLastDBTask(); | 238 FlushLastDBTask(); |
| 239 | 239 |
| 240 service_->SetPassphrase("foo", false, true); | 240 service_->SetPassphrase("foo", false); |
| 241 MessageLoop::current()->Run(); | 241 MessageLoop::current()->Run(); |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 | 244 |
| 245 void AddPasswordSyncNode(const PasswordForm& entry) { | 245 void AddPasswordSyncNode(const PasswordForm& entry) { |
| 246 sync_api::WriteTransaction trans(FROM_HERE, service_->GetUserShare()); | 246 sync_api::WriteTransaction trans(FROM_HERE, service_->GetUserShare()); |
| 247 sync_api::ReadNode password_root(&trans); | 247 sync_api::ReadNode password_root(&trans); |
| 248 ASSERT_TRUE(password_root.InitByTagLookup(browser_sync::kPasswordTag)); | 248 ASSERT_TRUE(password_root.InitByTagLookup(browser_sync::kPasswordTag)); |
| 249 | 249 |
| 250 sync_api::WriteNode node(&trans); | 250 sync_api::WriteNode node(&trans); |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 AddPasswordEntriesTask node_task(this, sync_forms); | 615 AddPasswordEntriesTask node_task(this, sync_forms); |
| 616 | 616 |
| 617 StartSyncService(&root_task, &node_task); | 617 StartSyncService(&root_task, &node_task); |
| 618 | 618 |
| 619 std::vector<PasswordForm> new_sync_forms; | 619 std::vector<PasswordForm> new_sync_forms; |
| 620 GetPasswordEntriesFromSyncDB(&new_sync_forms); | 620 GetPasswordEntriesFromSyncDB(&new_sync_forms); |
| 621 | 621 |
| 622 EXPECT_EQ(1U, new_sync_forms.size()); | 622 EXPECT_EQ(1U, new_sync_forms.size()); |
| 623 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); | 623 EXPECT_TRUE(ComparePasswords(expected_forms[0], new_sync_forms[0])); |
| 624 } | 624 } |
| OLD | NEW |