| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(MockAutofillClient); | 61 DISALLOW_COPY_AND_ASSIGN(MockAutofillClient); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace | 64 } // namespace |
| 65 | 65 |
| 66 class AutocompleteHistoryManagerTest : public testing::Test { | 66 class AutocompleteHistoryManagerTest : public testing::Test { |
| 67 protected: | 67 protected: |
| 68 AutocompleteHistoryManagerTest() {} | 68 AutocompleteHistoryManagerTest() {} |
| 69 | 69 |
| 70 virtual void SetUp() override { | 70 void SetUp() override { |
| 71 web_data_service_ = new MockWebDataService(); | 71 web_data_service_ = new MockWebDataService(); |
| 72 autofill_client_.reset(new MockAutofillClient(web_data_service_)); | 72 autofill_client_.reset(new MockAutofillClient(web_data_service_)); |
| 73 autofill_driver_.reset(new TestAutofillDriver()); | 73 autofill_driver_.reset(new TestAutofillDriver()); |
| 74 autocomplete_manager_.reset(new AutocompleteHistoryManager( | 74 autocomplete_manager_.reset(new AutocompleteHistoryManager( |
| 75 autofill_driver_.get(), autofill_client_.get())); | 75 autofill_driver_.get(), autofill_client_.get())); |
| 76 } | 76 } |
| 77 | 77 |
| 78 virtual void TearDown() override { | 78 void TearDown() override { autocomplete_manager_.reset(); } |
| 79 autocomplete_manager_.reset(); | |
| 80 } | |
| 81 | 79 |
| 82 base::MessageLoop message_loop_; | 80 base::MessageLoop message_loop_; |
| 83 scoped_refptr<MockWebDataService> web_data_service_; | 81 scoped_refptr<MockWebDataService> web_data_service_; |
| 84 scoped_ptr<AutocompleteHistoryManager> autocomplete_manager_; | 82 scoped_ptr<AutocompleteHistoryManager> autocomplete_manager_; |
| 85 scoped_ptr<AutofillDriver> autofill_driver_; | 83 scoped_ptr<AutofillDriver> autofill_driver_; |
| 86 scoped_ptr<MockAutofillClient> autofill_client_; | 84 scoped_ptr<MockAutofillClient> autofill_client_; |
| 87 }; | 85 }; |
| 88 | 86 |
| 89 // Tests that credit card numbers are not sent to the WebDatabase to be saved. | 87 // Tests that credit card numbers are not sent to the WebDatabase to be saved. |
| 90 TEST_F(AutocompleteHistoryManagerTest, CreditCardNumberValue) { | 88 TEST_F(AutocompleteHistoryManagerTest, CreditCardNumberValue) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 field.name, | 250 field.name, |
| 253 field.value, | 251 field.value, |
| 254 field.form_control_type, | 252 field.form_control_type, |
| 255 std::vector<base::string16>(), | 253 std::vector<base::string16>(), |
| 256 std::vector<base::string16>(), | 254 std::vector<base::string16>(), |
| 257 std::vector<base::string16>(), | 255 std::vector<base::string16>(), |
| 258 std::vector<int>()); | 256 std::vector<int>()); |
| 259 } | 257 } |
| 260 | 258 |
| 261 } // namespace autofill | 259 } // namespace autofill |
| OLD | NEW |