OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/strings/string_util.h" | 5 #include "base/strings/string_util.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/test/base/chrome_render_view_test.h" | 7 #include "chrome/test/base/chrome_render_view_test.h" |
8 #include "components/autofill/content/common/autofill_messages.h" | 8 #include "components/autofill/content/common/autofill_messages.h" |
9 #include "components/autofill/content/renderer/autofill_agent.h" | 9 #include "components/autofill/content/renderer/autofill_agent.h" |
10 #include "components/autofill/content/renderer/form_autofill_util.h" | 10 #include "components/autofill/content/renderer/form_autofill_util.h" |
11 #include "components/autofill/content/renderer/password_autofill_agent.h" | 11 #include "components/autofill/content/renderer/password_autofill_agent.h" |
12 #include "components/autofill/content/renderer/test_password_autofill_agent.h" | 12 #include "components/autofill/content/renderer/test_password_autofill_agent.h" |
13 #include "components/autofill/core/common/form_data.h" | 13 #include "components/autofill/core/common/form_data.h" |
14 #include "components/autofill/core/common/form_field_data.h" | 14 #include "components/autofill/core/common/form_field_data.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "third_party/WebKit/public/platform/WebString.h" | 16 #include "third_party/WebKit/public/platform/WebString.h" |
17 #include "third_party/WebKit/public/platform/WebVector.h" | 17 #include "third_party/WebKit/public/platform/WebVector.h" |
18 #include "third_party/WebKit/public/web/WebDocument.h" | 18 #include "third_party/WebKit/public/web/WebDocument.h" |
19 #include "third_party/WebKit/public/web/WebElement.h" | 19 #include "third_party/WebKit/public/web/WebElement.h" |
20 #include "third_party/WebKit/public/web/WebFormElement.h" | 20 #include "third_party/WebKit/public/web/WebFormElement.h" |
21 #include "third_party/WebKit/public/web/WebFrame.h" | 21 #include "third_party/WebKit/public/web/WebFrame.h" |
22 #include "third_party/WebKit/public/web/WebInputElement.h" | 22 #include "third_party/WebKit/public/web/WebInputElement.h" |
23 #include "third_party/WebKit/public/web/WebNode.h" | 23 #include "third_party/WebKit/public/web/WebNode.h" |
24 #include "third_party/WebKit/public/web/WebView.h" | 24 #include "third_party/WebKit/public/web/WebView.h" |
25 #include "ui/events/keycodes/keyboard_codes.h" | 25 #include "ui/events/keycodes/keyboard_codes.h" |
26 | 26 |
27 using autofill::PasswordForm; | 27 using autofill::PasswordForm; |
| 28 using base::ASCIIToUTF16; |
| 29 using base::UTF16ToUTF8; |
28 using blink::WebDocument; | 30 using blink::WebDocument; |
29 using blink::WebElement; | 31 using blink::WebElement; |
30 using blink::WebFrame; | 32 using blink::WebFrame; |
31 using blink::WebInputElement; | 33 using blink::WebInputElement; |
32 using blink::WebString; | 34 using blink::WebString; |
33 using blink::WebView; | 35 using blink::WebView; |
34 | 36 |
35 namespace { | 37 namespace { |
36 | 38 |
37 // The name of the username/password element in the form. | 39 // The name of the username/password element in the form. |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 // Verfies that a DOM-activated UI event will not cause an autofill. | 819 // Verfies that a DOM-activated UI event will not cause an autofill. |
818 TEST_F(PasswordAutofillAgentTest, NoDOMActivationTest) { | 820 TEST_F(PasswordAutofillAgentTest, NoDOMActivationTest) { |
819 // Trigger the initial autocomplete. | 821 // Trigger the initial autocomplete. |
820 SimulateOnFillPasswordForm(fill_data_); | 822 SimulateOnFillPasswordForm(fill_data_); |
821 | 823 |
822 ExecuteJavaScript(kJavaScriptClick); | 824 ExecuteJavaScript(kJavaScriptClick); |
823 CheckTextFieldsDOMState(kAliceUsername, true, "", true); | 825 CheckTextFieldsDOMState(kAliceUsername, true, "", true); |
824 } | 826 } |
825 | 827 |
826 } // namespace autofill | 828 } // namespace autofill |
OLD | NEW |