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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 | 63 |
64 // Waits for a network request with the |expected_upload_data_|. | 64 // Waits for a network request with the |expected_upload_data_|. |
65 void Wait() { | 65 void Wait() { |
66 message_loop_runner_->Run(); | 66 message_loop_runner_->Run(); |
67 factory_.reset(); | 67 factory_.reset(); |
68 } | 68 } |
69 | 69 |
70 // net::TestURLFetcher::DelegateForTests: | 70 // net::TestURLFetcher::DelegateForTests: |
71 void OnRequestStart(int fetcher_id) override { | 71 void OnRequestStart(int fetcher_id) override { |
72 net::TestURLFetcher* fetcher = factory_->GetFetcherByID(fetcher_id); | 72 net::TestURLFetcher* fetcher = factory_->GetFetcherByID(fetcher_id); |
73 LOG(INFO) << fetcher->upload_data(); | |
Ilya Sherman
2014/10/24 01:24:45
nit: Please revert.
Garrett Casto
2014/10/24 21:13:09
Done.
| |
73 if (fetcher->upload_data() == expected_upload_data_) | 74 if (fetcher->upload_data() == expected_upload_data_) |
74 message_loop_runner_->Quit(); | 75 message_loop_runner_->Quit(); |
75 | 76 |
76 // Not interested in any further status updates from this fetcher. | 77 // Not interested in any further status updates from this fetcher. |
77 fetcher->SetDelegateForTests(NULL); | 78 fetcher->SetDelegateForTests(NULL); |
78 } | 79 } |
79 void OnChunkUpload(int fetcher_id) override {} | 80 void OnChunkUpload(int fetcher_id) override {} |
80 void OnRequestEnd(int fetcher_id) override {} | 81 void OnRequestEnd(int fetcher_id) override {} |
81 | 82 |
82 private: | 83 private: |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 "<field signature=\"1236501728\" autofilltype=\"2\"/>" | 163 "<field signature=\"1236501728\" autofilltype=\"2\"/>" |
163 "</autofillupload>"; | 164 "</autofillupload>"; |
164 WindowedNetworkObserver upload_network_observer(kUploadRequest); | 165 WindowedNetworkObserver upload_network_observer(kUploadRequest); |
165 content::WebContents* web_contents = | 166 content::WebContents* web_contents = |
166 browser()->tab_strip_model()->GetActiveWebContents(); | 167 browser()->tab_strip_model()->GetActiveWebContents(); |
167 content::SimulateMouseClick( | 168 content::SimulateMouseClick( |
168 web_contents, 0, blink::WebMouseEvent::ButtonLeft); | 169 web_contents, 0, blink::WebMouseEvent::ButtonLeft); |
169 upload_network_observer.Wait(); | 170 upload_network_observer.Wait(); |
170 } | 171 } |
171 | 172 |
173 // Verify that a site with password fields will query even in the presence | |
174 // of user defined autocomplete types. | |
175 IN_PROC_BROWSER_TEST_F(AutofillServerTest, | |
176 AlwaysQueryForPasswordFields) { | |
177 // Load the test page. Expect a query request upon loading the page. | |
178 const char kDataURIPrefix[] = "data:text/html;charset=utf-8,"; | |
179 const char kFormHtml[] = | |
180 "<form id='test_form'>" | |
181 " <input type='text' id='one' autocomplete='username'>" | |
182 " <input type='text' id='two' autocomplete='off'>" | |
183 " <input type='password' id='three'>" | |
184 " <input type='submit'>" | |
185 "</form>"; | |
186 const char kQueryRequest[] = | |
187 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" | |
188 "<autofillquery clientversion=\"6.1.1715.1442/en (GGLL)\">" | |
189 "<form signature=\"8900697631820480876\">" | |
190 "<field signature=\"2594484045\"/>" | |
191 "<field signature=\"2750915947\"/>" | |
192 "<field signature=\"116843943\"/>" | |
193 "</form>" | |
194 "</autofillquery>"; | |
195 WindowedNetworkObserver query_network_observer(kQueryRequest); | |
196 ui_test_utils::NavigateToURL( | |
197 browser(), GURL(std::string(kDataURIPrefix) + kFormHtml)); | |
198 query_network_observer.Wait(); | |
199 } | |
200 | |
172 } // namespace autofill | 201 } // namespace autofill |
OLD | NEW |