OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/macros.h" | 5 #include "base/macros.h" |
6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 "<field signature=\"1236501728\" autofilltype=\"2\"/>" | 162 "<field signature=\"1236501728\" autofilltype=\"2\"/>" |
163 "</autofillupload>"; | 163 "</autofillupload>"; |
164 WindowedNetworkObserver upload_network_observer(kUploadRequest); | 164 WindowedNetworkObserver upload_network_observer(kUploadRequest); |
165 content::WebContents* web_contents = | 165 content::WebContents* web_contents = |
166 browser()->tab_strip_model()->GetActiveWebContents(); | 166 browser()->tab_strip_model()->GetActiveWebContents(); |
167 content::SimulateMouseClick( | 167 content::SimulateMouseClick( |
168 web_contents, 0, blink::WebMouseEvent::ButtonLeft); | 168 web_contents, 0, blink::WebMouseEvent::ButtonLeft); |
169 upload_network_observer.Wait(); | 169 upload_network_observer.Wait(); |
170 } | 170 } |
171 | 171 |
| 172 // Verify that a site with password fields will query even in the presence |
| 173 // of user defined autocomplete types. |
| 174 IN_PROC_BROWSER_TEST_F(AutofillServerTest, |
| 175 AlwaysQueryForPasswordFields) { |
| 176 // Load the test page. Expect a query request upon loading the page. |
| 177 const char kDataURIPrefix[] = "data:text/html;charset=utf-8,"; |
| 178 const char kFormHtml[] = |
| 179 "<form id='test_form'>" |
| 180 " <input type='text' id='one' autocomplete='username'>" |
| 181 " <input type='text' id='two' autocomplete='off'>" |
| 182 " <input type='password' id='three'>" |
| 183 " <input type='submit'>" |
| 184 "</form>"; |
| 185 const char kQueryRequest[] = |
| 186 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" |
| 187 "<autofillquery clientversion=\"6.1.1715.1442/en (GGLL)\">" |
| 188 "<form signature=\"8900697631820480876\">" |
| 189 "<field signature=\"2594484045\"/>" |
| 190 "<field signature=\"2750915947\"/>" |
| 191 "<field signature=\"116843943\"/>" |
| 192 "</form>" |
| 193 "</autofillquery>"; |
| 194 WindowedNetworkObserver query_network_observer(kQueryRequest); |
| 195 ui_test_utils::NavigateToURL( |
| 196 browser(), GURL(std::string(kDataURIPrefix) + kFormHtml)); |
| 197 query_network_observer.Wait(); |
| 198 } |
| 199 |
172 } // namespace autofill | 200 } // namespace autofill |
OLD | NEW |