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

Side by Side Diff: chrome/renderer/autofill/autofill_renderer_browsertest.cc

Issue 707173004: Refactor Autofill for out of process iframes (OOPIF). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/strings/stringprintf.h" 6 #include "base/strings/stringprintf.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/test/base/chrome_render_view_test.h" 8 #include "chrome/test/base/chrome_render_view_test.h"
9 #include "components/autofill/content/common/autofill_messages.h" 9 #include "components/autofill/content/common/autofill_messages.h"
10 #include "components/autofill/content/renderer/autofill_agent.h" 10 #include "components/autofill/content/renderer/autofill_agent.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // Don't want any delay for form state sync changes. This will still post a 51 // Don't want any delay for form state sync changes. This will still post a
52 // message so updates will get coalesced, but as soon as we spin the message 52 // message so updates will get coalesced, but as soon as we spin the message
53 // loop, it will generate an update. 53 // loop, it will generate an update.
54 SendContentStateImmediately(); 54 SendContentStateImmediately();
55 } 55 }
56 56
57 void SimulateRequestAutocompleteResult( 57 void SimulateRequestAutocompleteResult(
58 const blink::WebFormElement::AutocompleteResult& result, 58 const blink::WebFormElement::AutocompleteResult& result,
59 const base::string16& message) { 59 const base::string16& message) {
60 AutofillMsg_RequestAutocompleteResult msg(0, result, message, FormData()); 60 AutofillMsg_RequestAutocompleteResult msg(0, result, message, FormData());
61 static_cast<content::RenderViewObserver*>(autofill_agent_) 61 static_cast<content::RenderFrameObserver*>(autofill_agent_)
62 ->OnMessageReceived(msg); 62 ->OnMessageReceived(msg);
63 } 63 }
64 64
65 private: 65 private:
66 DISALLOW_COPY_AND_ASSIGN(AutofillRendererTest); 66 DISALLOW_COPY_AND_ASSIGN(AutofillRendererTest);
67 }; 67 };
68 68
69 TEST_F(AutofillRendererTest, SendForms) { 69 TEST_F(AutofillRendererTest, SendForms) {
70 LoadHTML("<form method='POST'>" 70 LoadHTML("<form method='POST'>"
71 " <input type='text' id='firstname'/>" 71 " <input type='text' id='firstname'/>"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 364
365 TEST_F(RequestAutocompleteRendererTest, InvokingTwiceOnlyShowsOnce) { 365 TEST_F(RequestAutocompleteRendererTest, InvokingTwiceOnlyShowsOnce) {
366 // Attempting to show the requestAutocomplete dialog again should be ignored. 366 // Attempting to show the requestAutocomplete dialog again should be ignored.
367 static_cast<blink::WebAutofillClient*>(autofill_agent_) 367 static_cast<blink::WebAutofillClient*>(autofill_agent_)
368 ->didRequestAutocomplete(invoking_form()); 368 ->didRequestAutocomplete(invoking_form());
369 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( 369 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching(
370 AutofillHostMsg_RequestAutocomplete::ID)); 370 AutofillHostMsg_RequestAutocomplete::ID));
371 } 371 }
372 372
373 } // namespace autofill 373 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698