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/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 ACTION(STLDeleteElements0) { | 253 ACTION(STLDeleteElements0) { |
254 STLDeleteContainerPointers(arg0.begin(), arg0.end()); | 254 STLDeleteContainerPointers(arg0.begin(), arg0.end()); |
255 } | 255 } |
256 | 256 |
257 TEST_P(PasswordStoreXTest, Notifications) { | 257 TEST_P(PasswordStoreXTest, Notifications) { |
258 scoped_refptr<PasswordStoreX> store( | 258 scoped_refptr<PasswordStoreX> store( |
259 new PasswordStoreX(base::MessageLoopProxy::current(), | 259 new PasswordStoreX(base::MessageLoopProxy::current(), |
260 base::MessageLoopProxy::current(), | 260 base::MessageLoopProxy::current(), |
261 login_db_.release(), | 261 login_db_.release(), |
262 GetBackend())); | 262 GetBackend())); |
263 store->Init(); | 263 store->Init(syncer::SyncableService::StartSyncFlare()); |
264 | 264 |
265 PasswordFormData form_data = | 265 PasswordFormData form_data = |
266 { PasswordForm::SCHEME_HTML, | 266 { PasswordForm::SCHEME_HTML, |
267 "http://bar.example.com", | 267 "http://bar.example.com", |
268 "http://bar.example.com/origin", | 268 "http://bar.example.com/origin", |
269 "http://bar.example.com/action", | 269 "http://bar.example.com/action", |
270 L"submit_element", | 270 L"submit_element", |
271 L"username_element", | 271 L"username_element", |
272 L"password_element", | 272 L"password_element", |
273 L"username_value", | 273 L"username_value", |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 base::File::Info db_file_full_info; | 358 base::File::Info db_file_full_info; |
359 ASSERT_TRUE(base::GetFileInfo(login_db_file, &db_file_full_info)); | 359 ASSERT_TRUE(base::GetFileInfo(login_db_file, &db_file_full_info)); |
360 EXPECT_GT(db_file_full_info.size, db_file_start_info.size); | 360 EXPECT_GT(db_file_full_info.size, db_file_start_info.size); |
361 | 361 |
362 // Initializing the PasswordStore shouldn't trigger a native migration (yet). | 362 // Initializing the PasswordStore shouldn't trigger a native migration (yet). |
363 scoped_refptr<PasswordStoreX> store( | 363 scoped_refptr<PasswordStoreX> store( |
364 new PasswordStoreX(base::MessageLoopProxy::current(), | 364 new PasswordStoreX(base::MessageLoopProxy::current(), |
365 base::MessageLoopProxy::current(), | 365 base::MessageLoopProxy::current(), |
366 login_db_.release(), | 366 login_db_.release(), |
367 GetBackend())); | 367 GetBackend())); |
368 store->Init(); | 368 store->Init(syncer::SyncableService::StartSyncFlare()); |
369 | 369 |
370 MockPasswordStoreConsumer consumer; | 370 MockPasswordStoreConsumer consumer; |
371 | 371 |
372 // The autofillable forms should have been migrated to the native backend. | 372 // The autofillable forms should have been migrated to the native backend. |
373 EXPECT_CALL(consumer, | 373 EXPECT_CALL(consumer, |
374 OnGetPasswordStoreResults( | 374 OnGetPasswordStoreResults( |
375 ContainsAllPasswordForms(expected_autofillable))) | 375 ContainsAllPasswordForms(expected_autofillable))) |
376 .WillOnce(WithArg<0>(STLDeleteElements0())); | 376 .WillOnce(WithArg<0>(STLDeleteElements0())); |
377 | 377 |
378 store->GetAutofillableLogins(&consumer); | 378 store->GetAutofillableLogins(&consumer); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 | 442 |
443 INSTANTIATE_TEST_CASE_P(NoBackend, | 443 INSTANTIATE_TEST_CASE_P(NoBackend, |
444 PasswordStoreXTest, | 444 PasswordStoreXTest, |
445 testing::Values(NO_BACKEND)); | 445 testing::Values(NO_BACKEND)); |
446 INSTANTIATE_TEST_CASE_P(FailingBackend, | 446 INSTANTIATE_TEST_CASE_P(FailingBackend, |
447 PasswordStoreXTest, | 447 PasswordStoreXTest, |
448 testing::Values(FAILING_BACKEND)); | 448 testing::Values(FAILING_BACKEND)); |
449 INSTANTIATE_TEST_CASE_P(WorkingBackend, | 449 INSTANTIATE_TEST_CASE_P(WorkingBackend, |
450 PasswordStoreXTest, | 450 PasswordStoreXTest, |
451 testing::Values(WORKING_BACKEND)); | 451 testing::Values(WORKING_BACKEND)); |
OLD | NEW |