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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 int expiration_year = 3000; | 455 int expiration_year = 3000; |
456 EXPECT_CALL( | 456 EXPECT_CALL( |
457 *autofill_manager_, | 457 *autofill_manager_, |
458 FillCreditCardForm( | 458 FillCreditCardForm( |
459 _, _, _, CreditCard(card_number, expiration_month, expiration_year))); | 459 _, _, _, CreditCard(card_number, expiration_month, expiration_year))); |
460 external_delegate_->OnCreditCardScanned(card_number, expiration_month, | 460 external_delegate_->OnCreditCardScanned(card_number, expiration_month, |
461 expiration_year); | 461 expiration_year); |
462 } | 462 } |
463 | 463 |
464 TEST_F(AutofillExternalDelegateUnitTest, ExternalDelegateHideWarning) { | 464 TEST_F(AutofillExternalDelegateUnitTest, ExternalDelegateHideWarning) { |
465 CommandLine::ForCurrentProcess()->AppendSwitch( | 465 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
466 switches::kRespectAutocompleteOffForAutofill); | 466 switches::kRespectAutocompleteOffForAutofill); |
467 | 467 |
468 // Set up a field that shouldn't get autocompleted or display warnings. | 468 // Set up a field that shouldn't get autocompleted or display warnings. |
469 const FormData form; | 469 const FormData form; |
470 FormFieldData field; | 470 FormFieldData field; |
471 field.is_focusable = true; | 471 field.is_focusable = true; |
472 field.should_autocomplete = false; | 472 field.should_autocomplete = false; |
473 const gfx::RectF element_bounds; | 473 const gfx::RectF element_bounds; |
474 | 474 |
475 external_delegate_->OnQuery(kQueryId, form, field, element_bounds, false); | 475 external_delegate_->OnQuery(kQueryId, form, field, element_bounds, false); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 TEST_F(AutofillExternalDelegateUnitTest, ExternalDelegateFillFieldWithValue) { | 518 TEST_F(AutofillExternalDelegateUnitTest, ExternalDelegateFillFieldWithValue) { |
519 EXPECT_CALL(autofill_client_, HideAutofillPopup()); | 519 EXPECT_CALL(autofill_client_, HideAutofillPopup()); |
520 base::string16 dummy_string(ASCIIToUTF16("baz foo")); | 520 base::string16 dummy_string(ASCIIToUTF16("baz foo")); |
521 EXPECT_CALL(*autofill_driver_, | 521 EXPECT_CALL(*autofill_driver_, |
522 RendererShouldFillFieldWithValue(dummy_string)); | 522 RendererShouldFillFieldWithValue(dummy_string)); |
523 external_delegate_->DidAcceptSuggestion(dummy_string, | 523 external_delegate_->DidAcceptSuggestion(dummy_string, |
524 POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY); | 524 POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY); |
525 } | 525 } |
526 | 526 |
527 } // namespace autofill | 527 } // namespace autofill |
OLD | NEW |