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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } else { | 264 } else { |
265 return scoped_ptr<PromptObserver>(new InfoBarObserver(web_contents)); | 265 return scoped_ptr<PromptObserver>(new InfoBarObserver(web_contents)); |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 // Handles |request| to "/basic_auth". If "Authorization" header is present, | 269 // Handles |request| to "/basic_auth". If "Authorization" header is present, |
270 // responds with a non-empty HTTP 200 page (regardless of its value). Otherwise | 270 // responds with a non-empty HTTP 200 page (regardless of its value). Otherwise |
271 // serves a Basic Auth challenge. | 271 // serves a Basic Auth challenge. |
272 scoped_ptr<net::test_server::HttpResponse> HandleTestAuthRequest( | 272 scoped_ptr<net::test_server::HttpResponse> HandleTestAuthRequest( |
273 const net::test_server::HttpRequest& request) { | 273 const net::test_server::HttpRequest& request) { |
274 if (!base::StartsWithASCII(request.relative_url, "/basic_auth", true)) | 274 if (!base::StartsWith(request.relative_url, "/basic_auth", |
| 275 base::CompareCase::SENSITIVE)) |
275 return scoped_ptr<net::test_server::HttpResponse>(); | 276 return scoped_ptr<net::test_server::HttpResponse>(); |
276 | 277 |
277 if (ContainsKey(request.headers, "Authorization")) { | 278 if (ContainsKey(request.headers, "Authorization")) { |
278 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 279 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
279 new net::test_server::BasicHttpResponse); | 280 new net::test_server::BasicHttpResponse); |
280 http_response->set_code(net::HTTP_OK); | 281 http_response->set_code(net::HTTP_OK); |
281 http_response->set_content("Success!"); | 282 http_response->set_content("Success!"); |
282 return http_response.Pass(); | 283 return http_response.Pass(); |
283 } else { | 284 } else { |
284 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 285 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 content::SimulateMouseClickAt( | 2121 content::SimulateMouseClickAt( |
2121 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(left + 1, | 2122 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(left + 1, |
2122 top + 1)); | 2123 top + 1)); |
2123 // Verify password has been autofilled | 2124 // Verify password has been autofilled |
2124 WaitForElementValue("iframe", "password_field", "pa55w0rd"); | 2125 WaitForElementValue("iframe", "password_field", "pa55w0rd"); |
2125 | 2126 |
2126 // Verify username has been autofilled | 2127 // Verify username has been autofilled |
2127 CheckElementValue("iframe", "username_field", "temp"); | 2128 CheckElementValue("iframe", "username_field", "temp"); |
2128 | 2129 |
2129 } | 2130 } |
OLD | NEW |