OLD | NEW |
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> | 5 #include <string> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram_samples.h" | 8 #include "base/metrics/histogram_samples.h" |
9 #include "base/metrics/statistics_recorder.h" | 9 #include "base/metrics/statistics_recorder.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 scoped_ptr<net::test_server::HttpResponse> HandleTestAuthRequest( | 235 scoped_ptr<net::test_server::HttpResponse> HandleTestAuthRequest( |
236 const net::test_server::HttpRequest& request) { | 236 const net::test_server::HttpRequest& request) { |
237 if (!StartsWithASCII(request.relative_url, "/basic_auth", true)) | 237 if (!StartsWithASCII(request.relative_url, "/basic_auth", true)) |
238 return scoped_ptr<net::test_server::HttpResponse>(); | 238 return scoped_ptr<net::test_server::HttpResponse>(); |
239 | 239 |
240 if (ContainsKey(request.headers, "Authorization")) { | 240 if (ContainsKey(request.headers, "Authorization")) { |
241 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 241 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
242 new net::test_server::BasicHttpResponse); | 242 new net::test_server::BasicHttpResponse); |
243 http_response->set_code(net::HTTP_OK); | 243 http_response->set_code(net::HTTP_OK); |
244 http_response->set_content("Success!"); | 244 http_response->set_content("Success!"); |
245 return http_response.PassAs<net::test_server::HttpResponse>(); | 245 return http_response.Pass(); |
246 } else { | 246 } else { |
247 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 247 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
248 new net::test_server::BasicHttpResponse); | 248 new net::test_server::BasicHttpResponse); |
249 http_response->set_code(net::HTTP_UNAUTHORIZED); | 249 http_response->set_code(net::HTTP_UNAUTHORIZED); |
250 http_response->AddCustomHeader("WWW-Authenticate", | 250 http_response->AddCustomHeader("WWW-Authenticate", |
251 "Basic realm=\"test realm\""); | 251 "Basic realm=\"test realm\""); |
252 return http_response.PassAs<net::test_server::HttpResponse>(); | 252 return http_response.Pass(); |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 } // namespace | 256 } // namespace |
257 | 257 |
258 | 258 |
259 // PasswordManagerBrowserTest ------------------------------------------------- | 259 // PasswordManagerBrowserTest ------------------------------------------------- |
260 | 260 |
261 class PasswordManagerBrowserTest : public InProcessBrowserTest { | 261 class PasswordManagerBrowserTest : public InProcessBrowserTest { |
262 public: | 262 public: |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 NavigateToFile("/password/form_with_only_password_field.html"); | 1273 NavigateToFile("/password/form_with_only_password_field.html"); |
1274 | 1274 |
1275 // Let the user interact with the page, so that DOM gets modification events, | 1275 // Let the user interact with the page, so that DOM gets modification events, |
1276 // needed for autofilling fields. | 1276 // needed for autofilling fields. |
1277 content::SimulateMouseClickAt( | 1277 content::SimulateMouseClickAt( |
1278 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); | 1278 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); |
1279 | 1279 |
1280 // Wait until that interaction causes the password value to be revealed. | 1280 // Wait until that interaction causes the password value to be revealed. |
1281 WaitForElementValue("password", "mypassword"); | 1281 WaitForElementValue("password", "mypassword"); |
1282 } | 1282 } |
OLD | NEW |