| 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/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 | 414 |
| 415 // The enums must be cast to ints to prevent compile errors on linux_rel. | 415 // The enums must be cast to ints to prevent compile errors on linux_rel. |
| 416 EXPECT_CALL(manager_delegate_, | 416 EXPECT_CALL(manager_delegate_, |
| 417 ShowAutofillPopup( | 417 ShowAutofillPopup( |
| 418 _, _, _, _, _, | 418 _, _, _, _, _, |
| 419 testing::ElementsAre( | 419 testing::ElementsAre( |
| 420 static_cast<int>( | 420 static_cast<int>( |
| 421 WebAutofillClient::MenuItemIDPasswordEntry)), | 421 WebAutofillClient::MenuItemIDPasswordEntry)), |
| 422 _)); | 422 _)); |
| 423 | 423 |
| 424 PasswordForm password_form; |
| 424 external_delegate_->OnShowPasswordSuggestions(suggestions, | 425 external_delegate_->OnShowPasswordSuggestions(suggestions, |
| 425 realms, | 426 realms, |
| 426 field, | 427 field, |
| 428 password_form, |
| 427 element_bounds); | 429 element_bounds); |
| 428 | 430 |
| 429 EXPECT_CALL(manager_delegate_, HideAutofillPopup()); | 431 EXPECT_CALL(manager_delegate_, HideAutofillPopup()); |
| 430 | 432 |
| 431 // This should trigger a call to hide the popup since | 433 // This should trigger a call to hide the popup since |
| 432 // we've selected an option. | 434 // we've selected an option. |
| 433 external_delegate_->DidAcceptSuggestion( | 435 external_delegate_->DidAcceptSuggestion( |
| 434 suggestions[0], | 436 suggestions[0], |
| 435 WebAutofillClient::MenuItemIDPasswordEntry); | 437 WebAutofillClient::MenuItemIDPasswordEntry); |
| 436 } | 438 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 EXPECT_CALL(manager_delegate_, HideAutofillPopup()); | 490 EXPECT_CALL(manager_delegate_, HideAutofillPopup()); |
| 489 base::string16 dummy_string(ASCIIToUTF16("baz foo")); | 491 base::string16 dummy_string(ASCIIToUTF16("baz foo")); |
| 490 EXPECT_CALL(*autofill_driver_, | 492 EXPECT_CALL(*autofill_driver_, |
| 491 RendererShouldSetNodeText(dummy_string)); | 493 RendererShouldSetNodeText(dummy_string)); |
| 492 external_delegate_->DidAcceptSuggestion( | 494 external_delegate_->DidAcceptSuggestion( |
| 493 dummy_string, | 495 dummy_string, |
| 494 WebAutofillClient::MenuItemIDAutocompleteEntry); | 496 WebAutofillClient::MenuItemIDAutocompleteEntry); |
| 495 } | 497 } |
| 496 | 498 |
| 497 } // namespace autofill | 499 } // namespace autofill |
| OLD | NEW |