| 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 "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/test/histogram_tester.h" | 9 #include "base/test/histogram_tester.h" |
| 10 #include "chrome/renderer/autofill/password_generation_test_utils.h" | 10 #include "chrome/renderer/autofill/password_generation_test_utils.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 autofill::password_generation::GENERATION_POPUP_SHOWN, | 442 autofill::password_generation::GENERATION_POPUP_SHOWN, |
| 443 1); | 443 1); |
| 444 } | 444 } |
| 445 | 445 |
| 446 TEST_F(PasswordGenerationAgentTest, DynamicFormTest) { | 446 TEST_F(PasswordGenerationAgentTest, DynamicFormTest) { |
| 447 LoadHTMLWithUserGesture(kSigninFormHTML); | 447 LoadHTMLWithUserGesture(kSigninFormHTML); |
| 448 SetNotBlacklistedMessage(password_generation_, kSigninFormHTML); | 448 SetNotBlacklistedMessage(password_generation_, kSigninFormHTML); |
| 449 | 449 |
| 450 ExecuteJavaScriptForTests( | 450 ExecuteJavaScriptForTests( |
| 451 "var form = document.createElement('form');" | 451 "var form = document.createElement('form');" |
| 452 "form.action='http://www.random.com';" |
| 452 "var username = document.createElement('input');" | 453 "var username = document.createElement('input');" |
| 453 "username.type = 'text';" | 454 "username.type = 'text';" |
| 454 "username.id = 'dynamic_username';" | 455 "username.id = 'dynamic_username';" |
| 455 "var first_password = document.createElement('input');" | 456 "var first_password = document.createElement('input');" |
| 456 "first_password.type = 'password';" | 457 "first_password.type = 'password';" |
| 457 "first_password.id = 'first_password';" | 458 "first_password.id = 'first_password';" |
| 458 "first_password.name = 'first_password';" | 459 "first_password.name = 'first_password';" |
| 459 "var second_password = document.createElement('input');" | 460 "var second_password = document.createElement('input');" |
| 460 "second_password.type = 'password';" | 461 "second_password.type = 'password';" |
| 461 "second_password.id = 'second_password';" | 462 "second_password.id = 'second_password';" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 ExpectGenerationAvailable("first_password", false); | 554 ExpectGenerationAvailable("first_password", false); |
| 554 | 555 |
| 555 LoadHTMLWithUserGesture(kNewPasswordAutocompleteAttributeFormHTML); | 556 LoadHTMLWithUserGesture(kNewPasswordAutocompleteAttributeFormHTML); |
| 556 SetNotBlacklistedMessage(password_generation_, | 557 SetNotBlacklistedMessage(password_generation_, |
| 557 kNewPasswordAutocompleteAttributeFormHTML); | 558 kNewPasswordAutocompleteAttributeFormHTML); |
| 558 | 559 |
| 559 ExpectGenerationAvailable("first_password", false); | 560 ExpectGenerationAvailable("first_password", false); |
| 560 } | 561 } |
| 561 | 562 |
| 562 } // namespace autofill | 563 } // namespace autofill |
| OLD | NEW |