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/location.h" |
5 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
6 #include "base/message_loop/message_loop.h" | |
7 #include "base/prefs/pref_registry_simple.h" | 7 #include "base/prefs/pref_registry_simple.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/prefs/testing_pref_service.h" | 9 #include "base/prefs/testing_pref_service.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/single_thread_task_runner.h" |
11 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
12 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/thread_task_runner_handle.h" |
13 #include "components/autofill/core/browser/autofill_manager.h" | 15 #include "components/autofill/core/browser/autofill_manager.h" |
14 #include "components/autofill/core/browser/test_autofill_client.h" | 16 #include "components/autofill/core/browser/test_autofill_client.h" |
15 #include "components/autofill/core/browser/test_autofill_driver.h" | 17 #include "components/autofill/core/browser/test_autofill_driver.h" |
16 #include "components/autofill/core/browser/test_personal_data_manager.h" | 18 #include "components/autofill/core/browser/test_personal_data_manager.h" |
17 #include "components/autofill/core/common/password_form.h" | 19 #include "components/autofill/core/common/password_form.h" |
18 #include "components/password_manager/core/browser/mock_password_store.h" | 20 #include "components/password_manager/core/browser/mock_password_store.h" |
19 #include "components/password_manager/core/browser/password_form_manager.h" | 21 #include "components/password_manager/core/browser/password_form_manager.h" |
20 #include "components/password_manager/core/browser/password_manager.h" | 22 #include "components/password_manager/core/browser/password_manager.h" |
21 #include "components/password_manager/core/browser/password_manager_driver.h" | 23 #include "components/password_manager/core/browser/password_manager_driver.h" |
22 #include "components/password_manager/core/browser/password_store.h" | 24 #include "components/password_manager/core/browser/password_store.h" |
(...skipping 12 matching lines...) Expand all Loading... |
35 using ::testing::NiceMock; | 37 using ::testing::NiceMock; |
36 using ::testing::Return; | 38 using ::testing::Return; |
37 using ::testing::SaveArg; | 39 using ::testing::SaveArg; |
38 | 40 |
39 namespace password_manager { | 41 namespace password_manager { |
40 | 42 |
41 namespace { | 43 namespace { |
42 | 44 |
43 void RunAllPendingTasks() { | 45 void RunAllPendingTasks() { |
44 base::RunLoop run_loop; | 46 base::RunLoop run_loop; |
45 base::MessageLoop::current()->PostTask( | 47 base::ThreadTaskRunnerHandle::Get()->PostTask( |
46 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); | 48 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
47 run_loop.Run(); | 49 run_loop.Run(); |
48 } | 50 } |
49 | 51 |
50 class MockAutofillManager : public autofill::AutofillManager { | 52 class MockAutofillManager : public autofill::AutofillManager { |
51 public: | 53 public: |
52 MockAutofillManager(autofill::AutofillDriver* driver, | 54 MockAutofillManager(autofill::AutofillDriver* driver, |
53 autofill::AutofillClient* client, | 55 autofill::AutofillClient* client, |
54 autofill::PersonalDataManager* data_manager) | 56 autofill::PersonalDataManager* data_manager) |
55 : AutofillManager(driver, client, data_manager) {} | 57 : AutofillManager(driver, client, data_manager) {} |
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 PasswordForm form; | 1516 PasswordForm form; |
1515 form.password_element = base::ASCIIToUTF16("pwd"); | 1517 form.password_element = base::ASCIIToUTF16("pwd"); |
1516 form.new_password_element = base::ASCIIToUTF16("new_pwd"); | 1518 form.new_password_element = base::ASCIIToUTF16("new_pwd"); |
1517 form.password_value = base::ASCIIToUTF16("val"); | 1519 form.password_value = base::ASCIIToUTF16("val"); |
1518 base::string16 kNewValue = base::ASCIIToUTF16("new_val"); | 1520 base::string16 kNewValue = base::ASCIIToUTF16("new_val"); |
1519 form.new_password_value = kNewValue; | 1521 form.new_password_value = kNewValue; |
1520 EXPECT_EQ(kNewValue, PasswordFormManager::PasswordToSave(form)); | 1522 EXPECT_EQ(kNewValue, PasswordFormManager::PasswordToSave(form)); |
1521 } | 1523 } |
1522 | 1524 |
1523 } // namespace password_manager | 1525 } // namespace password_manager |
OLD | NEW |