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

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

Issue 974613002: Revert of Autofill: Disable autofill for fields outside of forms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/test/base/chrome_render_view_test.h" 9 #include "chrome/test/base/chrome_render_view_test.h"
10 #include "chrome/test/base/ui_test_utils.h" 10 #include "chrome/test/base/ui_test_utils.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 "document.documentElement.appendChild(foo);" 243 "document.documentElement.appendChild(foo);"
244 "newDoc = document.implementation.createDocument(" 244 "newDoc = document.implementation.createDocument("
245 " 'http://www.w3.org/1999/xhtml', 'html');" 245 " 'http://www.w3.org/1999/xhtml', 'html');"
246 "foo.insertBefore(form, script);" 246 "foo.insertBefore(form, script);"
247 "newDoc.adoptNode(foo);" 247 "newDoc.adoptNode(foo);"
248 "</script>"); 248 "</script>");
249 249
250 // Shouldn't crash. 250 // Shouldn't crash.
251 } 251 }
252 252
253 TEST_F(AutofillRendererTest, DISABLED_DynamicallyAddedUnownedFormElements) { 253 TEST_F(AutofillRendererTest, DynamicallyAddedUnownedFormElements) {
254 std::string html_data; 254 std::string html_data;
255 base::FilePath test_path = ui_test_utils::GetTestFilePath( 255 base::FilePath test_path = ui_test_utils::GetTestFilePath(
256 base::FilePath(FILE_PATH_LITERAL("autofill")), 256 base::FilePath(FILE_PATH_LITERAL("autofill")),
257 base::FilePath(FILE_PATH_LITERAL("autofill_noform_dynamic.html"))); 257 base::FilePath(FILE_PATH_LITERAL("autofill_noform_dynamic.html")));
258 ASSERT_TRUE(base::ReadFileToString(test_path, &html_data)); 258 ASSERT_TRUE(base::ReadFileToString(test_path, &html_data));
259 LoadHTML(html_data.c_str()); 259 LoadHTML(html_data.c_str());
260 260
261 // Verify that "FormsSeen" sends the expected number of fields. 261 // Verify that "FormsSeen" sends the expected number of fields.
262 const IPC::Message* message = render_thread_->sink().GetFirstMessageMatching( 262 const IPC::Message* message = render_thread_->sink().GetFirstMessageMatching(
263 AutofillHostMsg_FormsSeen::ID); 263 AutofillHostMsg_FormsSeen::ID);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 }; 367 };
368 368
369 TEST_F(RequestAutocompleteRendererTest, InvokingTwiceOnlyShowsOnce) { 369 TEST_F(RequestAutocompleteRendererTest, InvokingTwiceOnlyShowsOnce) {
370 // Attempting to show the requestAutocomplete dialog again should be ignored. 370 // Attempting to show the requestAutocomplete dialog again should be ignored.
371 invoking_frame_->autofillClient()->didRequestAutocomplete(invoking_form()); 371 invoking_frame_->autofillClient()->didRequestAutocomplete(invoking_form());
372 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching( 372 EXPECT_FALSE(render_thread_->sink().GetFirstMessageMatching(
373 AutofillHostMsg_RequestAutocomplete::ID)); 373 AutofillHostMsg_RequestAutocomplete::ID));
374 } 374 }
375 375
376 } // namespace autofill 376 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/autofill/form_structure_browsertest.cc ('k') | chrome/renderer/autofill/form_autofill_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698