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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2458 base::string16 expected_icons[] = { base::string16(), base::string16()}; | 2458 base::string16 expected_icons[] = { base::string16(), base::string16()}; |
2459 int expected_unique_ids[] = {0, 0}; | 2459 int expected_unique_ids[] = {0, 0}; |
2460 external_delegate_->CheckSuggestions( | 2460 external_delegate_->CheckSuggestions( |
2461 kDefaultPageID, arraysize(expected_values), expected_values, | 2461 kDefaultPageID, arraysize(expected_values), expected_values, |
2462 expected_labels, expected_icons, expected_unique_ids); | 2462 expected_labels, expected_icons, expected_unique_ids); |
2463 } | 2463 } |
2464 | 2464 |
2465 // Duplicate of the below test with the respect-autocomplete-off-autofill | 2465 // Duplicate of the below test with the respect-autocomplete-off-autofill |
2466 // switch. | 2466 // switch. |
2467 TEST_F(AutofillManagerTest, AutocompleteOffRespected) { | 2467 TEST_F(AutofillManagerTest, AutocompleteOffRespected) { |
2468 CommandLine::ForCurrentProcess()->AppendSwitch( | 2468 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
2469 switches::kRespectAutocompleteOffForAutofill); | 2469 switches::kRespectAutocompleteOffForAutofill); |
2470 | 2470 |
2471 TestAutofillClient client; | 2471 TestAutofillClient client; |
2472 autofill_manager_.reset( | 2472 autofill_manager_.reset( |
2473 new TestAutofillManager(autofill_driver_.get(), &client, NULL)); | 2473 new TestAutofillManager(autofill_driver_.get(), &client, NULL)); |
2474 autofill_manager_->set_autofill_enabled(false); | 2474 autofill_manager_->set_autofill_enabled(false); |
2475 autofill_manager_->SetExternalDelegate(external_delegate_.get()); | 2475 autofill_manager_->SetExternalDelegate(external_delegate_.get()); |
2476 | 2476 |
2477 scoped_ptr<MockAutocompleteHistoryManager> autocomplete_history_manager; | 2477 scoped_ptr<MockAutocompleteHistoryManager> autocomplete_history_manager; |
2478 autocomplete_history_manager.reset( | 2478 autocomplete_history_manager.reset( |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3106 base::string16 expected_values[] = {ASCIIToUTF16("************3456")}; | 3106 base::string16 expected_values[] = {ASCIIToUTF16("************3456")}; |
3107 base::string16 expected_labels[] = {ASCIIToUTF16("04/12")}; | 3107 base::string16 expected_labels[] = {ASCIIToUTF16("04/12")}; |
3108 base::string16 expected_icons[] = {ASCIIToUTF16(kVisaCard)}; | 3108 base::string16 expected_icons[] = {ASCIIToUTF16(kVisaCard)}; |
3109 int expected_unique_ids[] = {autofill_manager_->GetPackedCreditCardID(4)}; | 3109 int expected_unique_ids[] = {autofill_manager_->GetPackedCreditCardID(4)}; |
3110 external_delegate_->CheckSuggestions( | 3110 external_delegate_->CheckSuggestions( |
3111 kDefaultPageID, arraysize(expected_values), expected_values, | 3111 kDefaultPageID, arraysize(expected_values), expected_values, |
3112 expected_labels, expected_icons, expected_unique_ids); | 3112 expected_labels, expected_icons, expected_unique_ids); |
3113 } | 3113 } |
3114 | 3114 |
3115 } // namespace autofill | 3115 } // namespace autofill |
OLD | NEW |