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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 store->AddLogin(*form); | 358 store->AddLogin(*form); |
359 | 359 |
360 // The PasswordStore schedules tasks to run on the DB thread so we schedule | 360 // The PasswordStore schedules tasks to run on the DB thread so we schedule |
361 // yet another task to notify us that it's safe to carry on with the test. | 361 // yet another task to notify us that it's safe to carry on with the test. |
362 WaitableEvent done(false, false); | 362 WaitableEvent done(false, false); |
363 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 363 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
364 base::Bind(&WaitableEvent::Signal, base::Unretained(&done))); | 364 base::Bind(&WaitableEvent::Signal, base::Unretained(&done))); |
365 done.Wait(); | 365 done.Wait(); |
366 | 366 |
367 // Change the password. | 367 // Change the password. |
368 form->password_value = WideToUTF16(L"a different password"); | 368 form->password_value = base::WideToUTF16(L"a different password"); |
369 | 369 |
370 const PasswordStoreChange expected_update_changes[] = { | 370 const PasswordStoreChange expected_update_changes[] = { |
371 PasswordStoreChange(PasswordStoreChange::UPDATE, *form), | 371 PasswordStoreChange(PasswordStoreChange::UPDATE, *form), |
372 }; | 372 }; |
373 | 373 |
374 EXPECT_CALL(helper->observer(), | 374 EXPECT_CALL(helper->observer(), |
375 Observe(int(chrome::NOTIFICATION_LOGINS_CHANGED), | 375 Observe(int(chrome::NOTIFICATION_LOGINS_CHANGED), |
376 content::Source<PasswordStore>(store), | 376 content::Source<PasswordStore>(store), |
377 Property(&content::Details<const PasswordStoreChangeList>::ptr, | 377 Property(&content::Details<const PasswordStoreChangeList>::ptr, |
378 Pointee(ElementsAreArray( | 378 Pointee(ElementsAreArray( |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 | 548 |
549 INSTANTIATE_TEST_CASE_P(NoBackend, | 549 INSTANTIATE_TEST_CASE_P(NoBackend, |
550 PasswordStoreXTest, | 550 PasswordStoreXTest, |
551 testing::Values(NO_BACKEND)); | 551 testing::Values(NO_BACKEND)); |
552 INSTANTIATE_TEST_CASE_P(FailingBackend, | 552 INSTANTIATE_TEST_CASE_P(FailingBackend, |
553 PasswordStoreXTest, | 553 PasswordStoreXTest, |
554 testing::Values(FAILING_BACKEND)); | 554 testing::Values(FAILING_BACKEND)); |
555 INSTANTIATE_TEST_CASE_P(WorkingBackend, | 555 INSTANTIATE_TEST_CASE_P(WorkingBackend, |
556 PasswordStoreXTest, | 556 PasswordStoreXTest, |
557 testing::Values(WORKING_BACKEND)); | 557 testing::Values(WORKING_BACKEND)); |
OLD | NEW |