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

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

Issue 2134653002: Add delay to didAssociateFormControlsTimer so it doesn't fire too frequently (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <string.h> 5 #include <string.h>
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 "first_password.id = 'first_password';" 472 "first_password.id = 'first_password';"
473 "first_password.name = 'first_password';" 473 "first_password.name = 'first_password';"
474 "var second_password = document.createElement('input');" 474 "var second_password = document.createElement('input');"
475 "second_password.type = 'password';" 475 "second_password.type = 'password';"
476 "second_password.id = 'second_password';" 476 "second_password.id = 'second_password';"
477 "second_password.name = 'second_password';" 477 "second_password.name = 'second_password';"
478 "form.appendChild(username);" 478 "form.appendChild(username);"
479 "form.appendChild(first_password);" 479 "form.appendChild(first_password);"
480 "form.appendChild(second_password);" 480 "form.appendChild(second_password);"
481 "document.body.appendChild(form);"); 481 "document.body.appendChild(form);");
482 ProcessPendingMessages(); 482 WaitForAutofillDidAssociateFormControl();
483 483
484 // This needs to come after the DOM has been modified. 484 // This needs to come after the DOM has been modified.
485 SetAccountCreationFormsDetectedMessage(password_generation_, 485 SetAccountCreationFormsDetectedMessage(password_generation_,
486 GetMainFrame()->document(), 1, 1); 486 GetMainFrame()->document(), 1, 1);
487 487
488 // TODO(gcasto): I'm slightly worried about flakes in this test where 488 // TODO(gcasto): I'm slightly worried about flakes in this test where
489 // didAssociateFormControls() isn't called. If this turns out to be a problem 489 // didAssociateFormControls() isn't called. If this turns out to be a problem
490 // adding a call to OnDynamicFormsSeen(GetMainFrame()) will fix it, though 490 // adding a call to OnDynamicFormsSeen(GetMainFrame()) will fix it, though
491 // it will weaken the test. 491 // it will weaken the test.
492 ExpectGenerationAvailable("first_password", true); 492 ExpectGenerationAvailable("first_password", true);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 for (size_t i = 0; i < password.length(); ++i) 641 for (size_t i = 0; i < password.length(); ++i)
642 SimulateUserTypingASCIICharacter(ui::VKEY_BACK, false); 642 SimulateUserTypingASCIICharacter(ui::VKEY_BACK, false);
643 SimulateUserTypingASCIICharacter(ui::VKEY_BACK, true); 643 SimulateUserTypingASCIICharacter(ui::VKEY_BACK, true);
644 EXPECT_TRUE(render_thread_->sink().GetFirstMessageMatching( 644 EXPECT_TRUE(render_thread_->sink().GetFirstMessageMatching(
645 AutofillHostMsg_PasswordNoLongerGenerated::ID)); 645 AutofillHostMsg_PasswordNoLongerGenerated::ID));
646 render_thread_->sink().ClearMessages(); 646 render_thread_->sink().ClearMessages();
647 } 647 }
648 } 648 }
649 649
650 } // namespace autofill 650 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/renderer/autofill/autofill_renderer_browsertest.cc ('k') | chrome/test/base/chrome_render_view_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698