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 "base/ref_counted.h" | 7 #include "base/ref_counted.h" |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "base/scoped_vector.h" | 9 #include "base/scoped_vector.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
13 #include "base/tuple.h" | 13 #include "base/tuple.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "chrome/browser/autocomplete_history_manager.h" | 15 #include "chrome/browser/autocomplete_history_manager.h" |
16 #include "chrome/browser/autofill/autofill_common_test.h" | 16 #include "chrome/browser/autofill/autofill_common_test.h" |
17 #include "chrome/browser/autofill/autofill_manager.h" | 17 #include "chrome/browser/autofill/autofill_manager.h" |
18 #include "chrome/browser/autofill/autofill_profile.h" | 18 #include "chrome/browser/autofill/autofill_profile.h" |
19 #include "chrome/browser/autofill/credit_card.h" | 19 #include "chrome/browser/autofill/credit_card.h" |
20 #include "chrome/browser/autofill/personal_data_manager.h" | 20 #include "chrome/browser/autofill/personal_data_manager.h" |
21 #include "chrome/browser/prefs/pref_service.h" | 21 #include "chrome/browser/prefs/pref_service.h" |
22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
24 #include "chrome/common/autofill_messages.h" | 24 #include "chrome/common/autofill_messages.h" |
25 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
26 #include "chrome/test/testing_browser_process.h" | |
27 #include "chrome/test/testing_profile.h" | 26 #include "chrome/test/testing_profile.h" |
28 #include "content/browser/renderer_host/test_render_view_host.h" | 27 #include "content/browser/renderer_host/test_render_view_host.h" |
29 #include "content/browser/tab_contents/test_tab_contents.h" | 28 #include "content/browser/tab_contents/test_tab_contents.h" |
30 #include "googleurl/src/gurl.h" | 29 #include "googleurl/src/gurl.h" |
31 #include "grit/generated_resources.h" | 30 #include "grit/generated_resources.h" |
32 #include "ipc/ipc_test_sink.h" | 31 #include "ipc/ipc_test_sink.h" |
33 #include "testing/gtest/include/gtest/gtest.h" | 32 #include "testing/gtest/include/gtest/gtest.h" |
34 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
35 #include "webkit/glue/form_data.h" | 34 #include "webkit/glue/form_data.h" |
36 #include "webkit/glue/form_field.h" | 35 #include "webkit/glue/form_field.h" |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 if (page_id) | 542 if (page_id) |
544 *page_id = autofill_param.a; | 543 *page_id = autofill_param.a; |
545 if (results) | 544 if (results) |
546 *results = autofill_param.b; | 545 *results = autofill_param.b; |
547 | 546 |
548 process()->sink().ClearMessages(); | 547 process()->sink().ClearMessages(); |
549 return true; | 548 return true; |
550 } | 549 } |
551 | 550 |
552 protected: | 551 protected: |
553 ScopedTestingBrowserProcess browser_process_; | |
554 scoped_ptr<TestAutoFillManager> autofill_manager_; | 552 scoped_ptr<TestAutoFillManager> autofill_manager_; |
555 scoped_refptr<TestPersonalDataManager> test_personal_data_; | 553 scoped_refptr<TestPersonalDataManager> test_personal_data_; |
556 | 554 |
557 private: | 555 private: |
558 DISALLOW_COPY_AND_ASSIGN(AutoFillManagerTest); | 556 DISALLOW_COPY_AND_ASSIGN(AutoFillManagerTest); |
559 }; | 557 }; |
560 | 558 |
561 // Test that we return all address profile suggestions when all form fields are | 559 // Test that we return all address profile suggestions when all form fields are |
562 // empty. | 560 // empty. |
563 TEST_F(AutoFillManagerTest, GetProfileSuggestionsEmptyValue) { | 561 TEST_F(AutoFillManagerTest, GetProfileSuggestionsEmptyValue) { |
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1748 #else | 1746 #else |
1749 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( | 1747 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( |
1750 prefs::kAutoFillAuxiliaryProfilesEnabled)); | 1748 prefs::kAutoFillAuxiliaryProfilesEnabled)); |
1751 profile()->GetPrefs()->SetBoolean( | 1749 profile()->GetPrefs()->SetBoolean( |
1752 prefs::kAutoFillAuxiliaryProfilesEnabled, true); | 1750 prefs::kAutoFillAuxiliaryProfilesEnabled, true); |
1753 profile()->GetPrefs()->ClearPref(prefs::kAutoFillAuxiliaryProfilesEnabled); | 1751 profile()->GetPrefs()->ClearPref(prefs::kAutoFillAuxiliaryProfilesEnabled); |
1754 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( | 1752 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( |
1755 prefs::kAutoFillAuxiliaryProfilesEnabled)); | 1753 prefs::kAutoFillAuxiliaryProfilesEnabled)); |
1756 #endif | 1754 #endif |
1757 } | 1755 } |
OLD | NEW |