| 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 "chrome/test/base/chrome_render_view_test.h" | 9 #include "chrome/test/base/chrome_render_view_test.h" |
| 10 #include "components/autofill/content/common/autofill_messages.h" | 10 #include "components/autofill/content/common/autofill_messages.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 EXPECT_EQ(password, first_password_element.value()); | 164 EXPECT_EQ(password, first_password_element.value()); |
| 165 EXPECT_EQ(password, second_password_element.value()); | 165 EXPECT_EQ(password, second_password_element.value()); |
| 166 EXPECT_TRUE(first_password_element.isAutofilled()); | 166 EXPECT_TRUE(first_password_element.isAutofilled()); |
| 167 EXPECT_TRUE(second_password_element.isAutofilled()); | 167 EXPECT_TRUE(second_password_element.isAutofilled()); |
| 168 | 168 |
| 169 // Focus moved to the next input field. | 169 // Focus moved to the next input field. |
| 170 // TODO(zysxqn): Change this back to the address element once Bug 90224 | 170 // TODO(zysxqn): Change this back to the address element once Bug 90224 |
| 171 // https://bugs.webkit.org/show_bug.cgi?id=90224 has been fixed. | 171 // https://bugs.webkit.org/show_bug.cgi?id=90224 has been fixed. |
| 172 element = document.getElementById(WebString::fromUTF8("first_password")); | 172 element = document.getElementById(WebString::fromUTF8("first_password")); |
| 173 ASSERT_FALSE(element.isNull()); | 173 ASSERT_FALSE(element.isNull()); |
| 174 EXPECT_EQ(element, document.focusedNode()); | 174 EXPECT_EQ(element, document.focusedElement()); |
| 175 } | 175 } |
| 176 | 176 |
| 177 TEST_F(PasswordGenerationAgentTest, EditingTest) { | 177 TEST_F(PasswordGenerationAgentTest, EditingTest) { |
| 178 LoadHTML(kAccountCreationFormHTML); | 178 LoadHTML(kAccountCreationFormHTML); |
| 179 SetNotBlacklistedMessage(kAccountCreationFormHTML); | 179 SetNotBlacklistedMessage(kAccountCreationFormHTML); |
| 180 SetAccountCreationFormsDetectedMessage(kAccountCreationFormHTML); | 180 SetAccountCreationFormsDetectedMessage(kAccountCreationFormHTML); |
| 181 | 181 |
| 182 WebDocument document = GetMainFrame()->document(); | 182 WebDocument document = GetMainFrame()->document(); |
| 183 WebElement element = | 183 WebElement element = |
| 184 document.getElementById(WebString::fromUTF8("first_password")); | 184 document.getElementById(WebString::fromUTF8("first_password")); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 249 |
| 250 // Receive the account creation forms detected message. Show password | 250 // Receive the account creation forms detected message. Show password |
| 251 // generation icon. | 251 // generation icon. |
| 252 LoadHTML(kAccountCreationFormHTML); | 252 LoadHTML(kAccountCreationFormHTML); |
| 253 SetNotBlacklistedMessage(kAccountCreationFormHTML); | 253 SetNotBlacklistedMessage(kAccountCreationFormHTML); |
| 254 SetAccountCreationFormsDetectedMessage(kAccountCreationFormHTML); | 254 SetAccountCreationFormsDetectedMessage(kAccountCreationFormHTML); |
| 255 ExpectPasswordGenerationAvailable("first_password", true); | 255 ExpectPasswordGenerationAvailable("first_password", true); |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace autofill | 258 } // namespace autofill |
| OLD | NEW |