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

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

Issue 2928033002: Move GetDocument method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Split a DCHECK in two as suggested by boliu@. Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <tuple> 5 #include <tuple>
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // renderer. 134 // renderer.
135 void VerifyNoSubmitMessagesReceived( 135 void VerifyNoSubmitMessagesReceived(
136 const FakeContentAutofillDriver& fake_driver) { 136 const FakeContentAutofillDriver& fake_driver) {
137 // No submission messages sent. 137 // No submission messages sent.
138 EXPECT_EQ(nullptr, fake_driver.form_will_submit()); 138 EXPECT_EQ(nullptr, fake_driver.form_will_submit());
139 EXPECT_EQ(nullptr, fake_driver.form_submitted()); 139 EXPECT_EQ(nullptr, fake_driver.form_submitted());
140 } 140 }
141 141
142 // Simulates receiving a message from the browser to fill a form. 142 // Simulates receiving a message from the browser to fill a form.
143 void SimulateOnFillForm(autofill::AutofillAgent* autofill_agent, 143 void SimulateOnFillForm(autofill::AutofillAgent* autofill_agent,
144 blink::WebFrame* main_frame) { 144 blink::WebLocalFrame* main_frame) {
145 WebDocument document = main_frame->GetDocument(); 145 WebDocument document = main_frame->GetDocument();
146 WebElement element = document.GetElementById(WebString::FromUTF8("fname")); 146 WebElement element = document.GetElementById(WebString::FromUTF8("fname"));
147 ASSERT_FALSE(element.IsNull()); 147 ASSERT_FALSE(element.IsNull());
148 148
149 // This call is necessary to setup the autofill agent appropriate for the 149 // This call is necessary to setup the autofill agent appropriate for the
150 // user selection; simulates the menu actually popping up. 150 // user selection; simulates the menu actually popping up.
151 static_cast<autofill::PageClickListener*>(autofill_agent) 151 static_cast<autofill::PageClickListener*>(autofill_agent)
152 ->FormControlElementClicked(element.To<WebInputElement>(), false); 152 ->FormControlElementClicked(element.To<WebInputElement>(), false);
153 153
154 FormData data; 154 FormData data;
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 649
650 // Submit the form. 650 // Submit the form.
651 ExecuteJavaScriptForTests("document.getElementById('myForm').submit();"); 651 ExecuteJavaScriptForTests("document.getElementById('myForm').submit();");
652 base::RunLoop().RunUntilIdle(); 652 base::RunLoop().RunUntilIdle();
653 653
654 VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard", 654 VerifyReceivedRendererMessages(fake_driver_, "Rick", "Deckard",
655 true /* expect_submitted_message */); 655 true /* expect_submitted_message */);
656 } 656 }
657 657
658 } // namespace autofill 658 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/web_applications/web_app_unittest.cc ('k') | chrome/renderer/autofill/form_autofill_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698