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

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

Issue 165233003: Replace WebDocument::focusedNode to focusedElement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nits Created 6 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698