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

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

Issue 2083363002: Remove calls to deprecated MessageLoop methods in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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) 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 <tuple> 5 #include <tuple>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 "newLastname.setAttribute('id', 'second_lastname');" 127 "newLastname.setAttribute('id', 'second_lastname');"
128 "newLastname.value = 'Hope';" 128 "newLastname.value = 'Hope';"
129 "var newEmail=document.createElement('input');" 129 "var newEmail=document.createElement('input');"
130 "newEmail.setAttribute('type', 'text');" 130 "newEmail.setAttribute('type', 'text');"
131 "newEmail.setAttribute('id', 'second_email');" 131 "newEmail.setAttribute('id', 'second_email');"
132 "newEmail.value = 'bobhope@example.com';" 132 "newEmail.value = 'bobhope@example.com';"
133 "newForm.appendChild(newFirstname);" 133 "newForm.appendChild(newFirstname);"
134 "newForm.appendChild(newLastname);" 134 "newForm.appendChild(newLastname);"
135 "newForm.appendChild(newEmail);" 135 "newForm.appendChild(newEmail);"
136 "document.body.appendChild(newForm);"); 136 "document.body.appendChild(newForm);");
137 msg_loop_.RunUntilIdle(); 137 base::RunLoop().RunUntilIdle();
138 138
139 message = render_thread_->sink().GetFirstMessageMatching( 139 message = render_thread_->sink().GetFirstMessageMatching(
140 AutofillHostMsg_FormsSeen::ID); 140 AutofillHostMsg_FormsSeen::ID);
141 ASSERT_NE(nullptr, message); 141 ASSERT_NE(nullptr, message);
142 AutofillHostMsg_FormsSeen::Read(message, &params); 142 AutofillHostMsg_FormsSeen::Read(message, &params);
143 forms = std::get<0>(params); 143 forms = std::get<0>(params);
144 ASSERT_EQ(1UL, forms.size()); 144 ASSERT_EQ(1UL, forms.size());
145 ASSERT_EQ(3UL, forms[0].fields.size()); 145 ASSERT_EQ(3UL, forms[0].fields.size());
146 146
147 expected.form_control_type = "text"; 147 expected.form_control_type = "text";
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 ASSERT_NE(nullptr, message); 205 ASSERT_NE(nullptr, message);
206 AutofillHostMsg_FormsSeen::Param params; 206 AutofillHostMsg_FormsSeen::Param params;
207 AutofillHostMsg_FormsSeen::Read(message, &params); 207 AutofillHostMsg_FormsSeen::Read(message, &params);
208 std::vector<FormData> forms = std::get<0>(params); 208 std::vector<FormData> forms = std::get<0>(params);
209 ASSERT_EQ(1UL, forms.size()); 209 ASSERT_EQ(1UL, forms.size());
210 ASSERT_EQ(7UL, forms[0].fields.size()); 210 ASSERT_EQ(7UL, forms[0].fields.size());
211 211
212 render_thread_->sink().ClearMessages(); 212 render_thread_->sink().ClearMessages();
213 213
214 ExecuteJavaScriptForTests("AddFields()"); 214 ExecuteJavaScriptForTests("AddFields()");
215 msg_loop_.RunUntilIdle(); 215 base::RunLoop().RunUntilIdle();
216 216
217 message = render_thread_->sink().GetFirstMessageMatching( 217 message = render_thread_->sink().GetFirstMessageMatching(
218 AutofillHostMsg_FormsSeen::ID); 218 AutofillHostMsg_FormsSeen::ID);
219 ASSERT_NE(nullptr, message); 219 ASSERT_NE(nullptr, message);
220 AutofillHostMsg_FormsSeen::Read(message, &params); 220 AutofillHostMsg_FormsSeen::Read(message, &params);
221 forms = std::get<0>(params); 221 forms = std::get<0>(params);
222 ASSERT_EQ(1UL, forms.size()); 222 ASSERT_EQ(1UL, forms.size());
223 ASSERT_EQ(9UL, forms[0].fields.size()); 223 ASSERT_EQ(9UL, forms[0].fields.size());
224 224
225 FormFieldData expected; 225 FormFieldData expected;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 AutofillHostMsg_TextFieldDidChange::ID)); 257 AutofillHostMsg_TextFieldDidChange::ID));
258 258
259 // A user gesture will send a message to the browser. 259 // A user gesture will send a message to the browser.
260 EnableUserGestureSimulationForAutofill(); 260 EnableUserGestureSimulationForAutofill();
261 SimulateUserInputChangeForElement(&full_name, "Alice"); 261 SimulateUserInputChangeForElement(&full_name, "Alice");
262 ASSERT_NE(nullptr, render_thread_->sink().GetFirstMessageMatching( 262 ASSERT_NE(nullptr, render_thread_->sink().GetFirstMessageMatching(
263 AutofillHostMsg_TextFieldDidChange::ID)); 263 AutofillHostMsg_TextFieldDidChange::ID));
264 } 264 }
265 265
266 } // namespace autofill 266 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/common/service_process_util_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