| OLD | NEW |
| 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 "first_password.id = 'first_password';" | 496 "first_password.id = 'first_password';" |
| 497 "first_password.name = 'first_password';" | 497 "first_password.name = 'first_password';" |
| 498 "var second_password = document.createElement('input');" | 498 "var second_password = document.createElement('input');" |
| 499 "second_password.type = 'password';" | 499 "second_password.type = 'password';" |
| 500 "second_password.id = 'second_password';" | 500 "second_password.id = 'second_password';" |
| 501 "second_password.name = 'second_password';" | 501 "second_password.name = 'second_password';" |
| 502 "form.appendChild(username);" | 502 "form.appendChild(username);" |
| 503 "form.appendChild(first_password);" | 503 "form.appendChild(first_password);" |
| 504 "form.appendChild(second_password);" | 504 "form.appendChild(second_password);" |
| 505 "document.body.appendChild(form);"); | 505 "document.body.appendChild(form);"); |
| 506 ProcessPendingMessages(); | 506 WaitForAutofillDidAssociateFormControl(); |
| 507 | 507 |
| 508 // This needs to come after the DOM has been modified. | 508 // This needs to come after the DOM has been modified. |
| 509 SetAccountCreationFormsDetectedMessage(password_generation_, | 509 SetAccountCreationFormsDetectedMessage(password_generation_, |
| 510 GetMainFrame()->document(), 1, 1); | 510 GetMainFrame()->document(), 1, 1); |
| 511 | 511 |
| 512 // TODO(gcasto): I'm slightly worried about flakes in this test where | 512 // TODO(gcasto): I'm slightly worried about flakes in this test where |
| 513 // didAssociateFormControls() isn't called. If this turns out to be a problem | 513 // didAssociateFormControls() isn't called. If this turns out to be a problem |
| 514 // adding a call to OnDynamicFormsSeen(GetMainFrame()) will fix it, though | 514 // adding a call to OnDynamicFormsSeen(GetMainFrame()) will fix it, though |
| 515 // it will weaken the test. | 515 // it will weaken the test. |
| 516 ExpectGenerationAvailable("first_password", true); | 516 ExpectGenerationAvailable("first_password", true); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 base::string16()); | 685 base::string16()); |
| 686 } | 686 } |
| 687 | 687 |
| 688 TEST_F(PasswordGenerationAgentTest, FormClassifierDisabled) { | 688 TEST_F(PasswordGenerationAgentTest, FormClassifierDisabled) { |
| 689 LoadHTMLWithUserGesture(kSigninFormHTML); | 689 LoadHTMLWithUserGesture(kSigninFormHTML); |
| 690 ExpectFormClassifierVoteReceived(false /* vote is not expected */, | 690 ExpectFormClassifierVoteReceived(false /* vote is not expected */, |
| 691 base::string16()); | 691 base::string16()); |
| 692 } | 692 } |
| 693 | 693 |
| 694 } // namespace autofill | 694 } // namespace autofill |
| OLD | NEW |