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

Unified Diff: chrome/renderer/autofill/autofill_renderer_browsertest.cc

Issue 796493004: Remove FrameDetached and FrameWillClose listeners from AutofillAgent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test and fix code Created 6 years 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: chrome/renderer/autofill/autofill_renderer_browsertest.cc
diff --git a/chrome/renderer/autofill/autofill_renderer_browsertest.cc b/chrome/renderer/autofill/autofill_renderer_browsertest.cc
index cd1c8d3fbf583d8ac2af9e2b3257a61a2135f3c8..05d75c53472bbf362a01f6561cfd12a21aa38aac 100644
--- a/chrome/renderer/autofill/autofill_renderer_browsertest.cc
+++ b/chrome/renderer/autofill/autofill_renderer_browsertest.cc
@@ -366,51 +366,6 @@ class RequestAutocompleteRendererTest : public AutofillRendererTest {
DISALLOW_COPY_AND_ASSIGN(RequestAutocompleteRendererTest);
};
-TEST_F(RequestAutocompleteRendererTest, SiblingNavigateIgnored) {
- // Pretend that a sibling frame navigated. No cancel should be sent.
- NavigateFrame(sibling_frame());
- EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching(
- AutofillHostMsg_CancelRequestAutocomplete::ID));
-}
-
-TEST_F(RequestAutocompleteRendererTest, SubframeNavigateCancels) {
- // Pretend that the invoking frame navigated. A cancel should be sent.
- NavigateFrame(invoking_frame());
- EXPECT_TRUE(render_thread_->sink().GetFirstMessageMatching(
- AutofillHostMsg_CancelRequestAutocomplete::ID));
-}
-
-TEST_F(RequestAutocompleteRendererTest, MainFrameNavigateCancels) {
- // Pretend that the top-level frame navigated. A cancel should be sent.
- NavigateFrame(GetMainFrame());
- EXPECT_TRUE(render_thread_->sink().GetFirstMessageMatching(
- AutofillHostMsg_CancelRequestAutocomplete::ID));
-}
-
-TEST_F(RequestAutocompleteRendererTest, NoCancelOnSubframeNavigateAfterDone) {
- // Pretend that the dialog was cancelled.
- SimulateRequestAutocompleteResult(
- invoking_frame_, WebFormElement::AutocompleteResultErrorCancel,
- base::ASCIIToUTF16("Print me to the console"));
-
- // Additional navigations should not crash nor send cancels.
- NavigateFrame(invoking_frame());
- EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching(
- AutofillHostMsg_CancelRequestAutocomplete::ID));
-}
-
-TEST_F(RequestAutocompleteRendererTest, NoCancelOnMainFrameNavigateAfterDone) {
- // Pretend that the dialog was cancelled.
- SimulateRequestAutocompleteResult(
- invoking_frame_, WebFormElement::AutocompleteResultErrorCancel,
- base::ASCIIToUTF16("Print me to the console"));
-
- // Additional navigations should not crash nor send cancels.
- NavigateFrame(GetMainFrame());
- EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching(
- AutofillHostMsg_CancelRequestAutocomplete::ID));
-}
-
TEST_F(RequestAutocompleteRendererTest, InvokingTwiceOnlyShowsOnce) {
// Attempting to show the requestAutocomplete dialog again should be ignored.
invoking_frame_->autofillClient()->didRequestAutocomplete(invoking_form());

Powered by Google App Engine
This is Rietveld 408576698