Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Unified Diff: components/autofill/core/browser/autofill_external_delegate_unittest.cc

Issue 148413002: Add "previewing on hover" support for single-field autocomplete input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stated that no-op for new Autocomplete functions in autofill dialog file. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/autofill_external_delegate_unittest.cc
diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
index ad86d836bebc462876e46505413897ae12815aec..ec107fb4be109f25f56e4fea13701bcc0344c83b 100644
--- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc
+++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
@@ -375,6 +375,26 @@ TEST_F(AutofillExternalDelegateUnitTest, ExternalDelegateClearPreviewedForm) {
EXPECT_CALL(*autofill_driver_, SetRendererActionOnFormDataReception(
AutofillDriver::FORM_DATA_ACTION_PREVIEW));
external_delegate_->DidSelectSuggestion(1);
+
+ // Ensure selecting an AutoComplete entries will cause any previews to
+ // get cleared.
+ base::string16 suggestion_string(ASCIIToUTF16("baz foo"));
+ EXPECT_CALL(*autofill_driver_, RendererShouldClearPreviewedForm()).Times(1);
+ external_delegate_->DidSelectAutocompleteSuggestion(suggestion_string);
+}
+
+// Test that the ClearAutoCompletePreview call is only sent if the autocomplete
+// field was being previewed.
+TEST_F(AutofillExternalDelegateUnitTest,
+ ExternalDelegateClearAutocompletePreviewedField) {
+ base::string16 suggestion_string(ASCIIToUTF16("baz foo"));
+ EXPECT_CALL(*autofill_driver_,
+ RendererShouldSetNodeText(suggestion_string));
+
+ EXPECT_CALL(*autofill_driver_, RendererShouldClearPreviewedForm()).Times(1);
+ EXPECT_CALL(*autofill_driver_,
+ RendererShouldSetNodeText(ASCIIToUTF16("")));
+ external_delegate_->DidSelectAutocompleteSuggestion(suggestion_string);
}
// Test that the popup is hidden once we are done editing the autofill field.

Powered by Google App Engine
This is Rietveld 408576698