OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 ACTION(STLDeleteElements0) { | 278 ACTION(STLDeleteElements0) { |
279 STLDeleteContainerPointers(arg0.begin(), arg0.end()); | 279 STLDeleteContainerPointers(arg0.begin(), arg0.end()); |
280 } | 280 } |
281 | 281 |
282 TEST_P(PasswordStoreXTest, Notifications) { | 282 TEST_P(PasswordStoreXTest, Notifications) { |
283 scoped_refptr<PasswordStoreX> store( | 283 scoped_refptr<PasswordStoreX> store( |
284 new PasswordStoreX(base::MessageLoopProxy::current(), | 284 new PasswordStoreX(base::MessageLoopProxy::current(), |
285 base::MessageLoopProxy::current(), | 285 base::MessageLoopProxy::current(), |
286 login_db_.release(), | 286 login_db_.release(), |
287 GetBackend())); | 287 GetBackend())); |
288 store->Init(syncer::SyncableService::StartSyncFlare()); | 288 store->Init(syncer::SyncableService::StartSyncFlare(), ""); |
289 | 289 |
290 password_manager::PasswordFormData form_data = { | 290 password_manager::PasswordFormData form_data = { |
291 PasswordForm::SCHEME_HTML, "http://bar.example.com", | 291 PasswordForm::SCHEME_HTML, "http://bar.example.com", |
292 "http://bar.example.com/origin", "http://bar.example.com/action", | 292 "http://bar.example.com/origin", "http://bar.example.com/action", |
293 L"submit_element", L"username_element", | 293 L"submit_element", L"username_element", |
294 L"password_element", L"username_value", | 294 L"password_element", L"username_value", |
295 L"password_value", true, | 295 L"password_value", true, |
296 false, 1}; | 296 false, 1}; |
297 scoped_ptr<PasswordForm> form(CreatePasswordFormFromData(form_data)); | 297 scoped_ptr<PasswordForm> form(CreatePasswordFormFromData(form_data)); |
298 | 298 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 base::File::Info db_file_full_info; | 379 base::File::Info db_file_full_info; |
380 ASSERT_TRUE(base::GetFileInfo(login_db_file, &db_file_full_info)); | 380 ASSERT_TRUE(base::GetFileInfo(login_db_file, &db_file_full_info)); |
381 EXPECT_GT(db_file_full_info.size, db_file_start_info.size); | 381 EXPECT_GT(db_file_full_info.size, db_file_start_info.size); |
382 | 382 |
383 // Initializing the PasswordStore shouldn't trigger a native migration (yet). | 383 // Initializing the PasswordStore shouldn't trigger a native migration (yet). |
384 scoped_refptr<PasswordStoreX> store( | 384 scoped_refptr<PasswordStoreX> store( |
385 new PasswordStoreX(base::MessageLoopProxy::current(), | 385 new PasswordStoreX(base::MessageLoopProxy::current(), |
386 base::MessageLoopProxy::current(), | 386 base::MessageLoopProxy::current(), |
387 login_db_.release(), | 387 login_db_.release(), |
388 GetBackend())); | 388 GetBackend())); |
389 store->Init(syncer::SyncableService::StartSyncFlare()); | 389 store->Init(syncer::SyncableService::StartSyncFlare(), ""); |
390 | 390 |
391 MockPasswordStoreConsumer consumer; | 391 MockPasswordStoreConsumer consumer; |
392 | 392 |
393 // The autofillable forms should have been migrated to the native backend. | 393 // The autofillable forms should have been migrated to the native backend. |
394 EXPECT_CALL(consumer, | 394 EXPECT_CALL(consumer, |
395 OnGetPasswordStoreResults( | 395 OnGetPasswordStoreResults( |
396 ContainsAllPasswordForms(expected_autofillable))) | 396 ContainsAllPasswordForms(expected_autofillable))) |
397 .WillOnce(WithArg<0>(STLDeleteElements0())); | 397 .WillOnce(WithArg<0>(STLDeleteElements0())); |
398 | 398 |
399 store->GetAutofillableLogins(&consumer); | 399 store->GetAutofillableLogins(&consumer); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 INSTANTIATE_TEST_CASE_P(NoBackend, | 464 INSTANTIATE_TEST_CASE_P(NoBackend, |
465 PasswordStoreXTest, | 465 PasswordStoreXTest, |
466 testing::Values(NO_BACKEND)); | 466 testing::Values(NO_BACKEND)); |
467 INSTANTIATE_TEST_CASE_P(FailingBackend, | 467 INSTANTIATE_TEST_CASE_P(FailingBackend, |
468 PasswordStoreXTest, | 468 PasswordStoreXTest, |
469 testing::Values(FAILING_BACKEND)); | 469 testing::Values(FAILING_BACKEND)); |
470 INSTANTIATE_TEST_CASE_P(WorkingBackend, | 470 INSTANTIATE_TEST_CASE_P(WorkingBackend, |
471 PasswordStoreXTest, | 471 PasswordStoreXTest, |
472 testing::Values(WORKING_BACKEND)); | 472 testing::Values(WORKING_BACKEND)); |
OLD | NEW |