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" |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
876 LoadHTML(page_html.c_str()); | 876 LoadHTML(page_html.c_str()); |
877 | 877 |
878 // Set the expected form origin and action URLs. | 878 // Set the expected form origin and action URLs. |
879 fill_data_.origin = GURL(origin); | 879 fill_data_.origin = GURL(origin); |
880 fill_data_.action = GURL(origin); | 880 fill_data_.action = GURL(origin); |
881 | 881 |
882 // Retrieve the input elements from the iframe since that is where we want to | 882 // Retrieve the input elements from the iframe since that is where we want to |
883 // test the autofill. | 883 // test the autofill. |
884 WebFrame* iframe = GetMainFrame()->findChildByName(kIframeName); | 884 WebFrame* iframe = GetMainFrame()->findChildByName(kIframeName); |
885 ASSERT_TRUE(iframe); | 885 ASSERT_TRUE(iframe); |
886 static_cast<AutofillAgent*>(iframe->toWebLocalFrame()->autofillClient()) | |
887 ->DisableUserGestureCheckForTests(); | |
Evan Stade
2015/03/23 22:07:12
This doesn't seem right to me. Instead of modifyin
| |
886 | 888 |
887 SimulateOnFillPasswordFormForFrame(iframe, fill_data_); | 889 SimulateOnFillPasswordFormForFrame(iframe, fill_data_); |
888 | 890 |
889 WebDocument document = iframe->document(); | 891 WebDocument document = iframe->document(); |
890 | 892 |
891 WebElement username_element = document.getElementById(kUsernameName); | 893 WebElement username_element = document.getElementById(kUsernameName); |
892 WebElement password_element = document.getElementById(kPasswordName); | 894 WebElement password_element = document.getElementById(kPasswordName); |
893 ASSERT_FALSE(username_element.isNull()); | 895 ASSERT_FALSE(username_element.isNull()); |
894 ASSERT_FALSE(password_element.isNull()); | 896 ASSERT_FALSE(password_element.isNull()); |
895 | 897 |
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1848 | 1850 |
1849 ClearUsernameAndPasswordFields(); | 1851 ClearUsernameAndPasswordFields(); |
1850 | 1852 |
1851 username_element_.setValue("foobar"); | 1853 username_element_.setValue("foobar"); |
1852 SetElementReadOnly(username_element_, true); | 1854 SetElementReadOnly(username_element_, true); |
1853 | 1855 |
1854 CheckTextFieldsState(std::string("foobar"), false, std::string(), false); | 1856 CheckTextFieldsState(std::string("foobar"), false, std::string(), false); |
1855 } | 1857 } |
1856 | 1858 |
1857 } // namespace autofill | 1859 } // namespace autofill |
OLD | NEW |