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 #include <utility> |
6 | 7 |
7 #include "base/command_line.h" | 8 #include "base/command_line.h" |
8 #include "base/macros.h" | 9 #include "base/macros.h" |
9 #include "base/metrics/histogram_samples.h" | 10 #include "base/metrics/histogram_samples.h" |
10 #include "base/metrics/statistics_recorder.h" | 11 #include "base/metrics/statistics_recorder.h" |
11 #include "base/path_service.h" | 12 #include "base/path_service.h" |
12 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
13 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
14 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
15 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 const net::test_server::HttpRequest& request) { | 92 const net::test_server::HttpRequest& request) { |
92 if (!base::StartsWith(request.relative_url, "/basic_auth", | 93 if (!base::StartsWith(request.relative_url, "/basic_auth", |
93 base::CompareCase::SENSITIVE)) | 94 base::CompareCase::SENSITIVE)) |
94 return scoped_ptr<net::test_server::HttpResponse>(); | 95 return scoped_ptr<net::test_server::HttpResponse>(); |
95 | 96 |
96 if (ContainsKey(request.headers, "Authorization")) { | 97 if (ContainsKey(request.headers, "Authorization")) { |
97 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 98 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
98 new net::test_server::BasicHttpResponse); | 99 new net::test_server::BasicHttpResponse); |
99 http_response->set_code(net::HTTP_OK); | 100 http_response->set_code(net::HTTP_OK); |
100 http_response->set_content("Success!"); | 101 http_response->set_content("Success!"); |
101 return http_response.Pass(); | 102 return std::move(http_response); |
102 } else { | 103 } else { |
103 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 104 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
104 new net::test_server::BasicHttpResponse); | 105 new net::test_server::BasicHttpResponse); |
105 http_response->set_code(net::HTTP_UNAUTHORIZED); | 106 http_response->set_code(net::HTTP_UNAUTHORIZED); |
106 http_response->AddCustomHeader("WWW-Authenticate", | 107 http_response->AddCustomHeader("WWW-Authenticate", |
107 "Basic realm=\"test realm\""); | 108 "Basic realm=\"test realm\""); |
108 return http_response.Pass(); | 109 return std::move(http_response); |
109 } | 110 } |
110 } | 111 } |
111 | 112 |
112 class ObservingAutofillClient : public autofill::TestAutofillClient { | 113 class ObservingAutofillClient : public autofill::TestAutofillClient { |
113 public: | 114 public: |
114 ObservingAutofillClient() | 115 ObservingAutofillClient() |
115 : message_loop_runner_(new content::MessageLoopRunner) {} | 116 : message_loop_runner_(new content::MessageLoopRunner) {} |
116 ~ObservingAutofillClient() override {} | 117 ~ObservingAutofillClient() override {} |
117 | 118 |
118 void Wait() { message_loop_runner_->Run(); } | 119 void Wait() { message_loop_runner_->Run(); } |
(...skipping 2802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2921 std::string submit = | 2922 std::string submit = |
2922 "document.getElementById('username').value = 'temp';" | 2923 "document.getElementById('username').value = 'temp';" |
2923 "document.getElementById('password').value = 'mypassword';" | 2924 "document.getElementById('password').value = 'mypassword';" |
2924 "document.getElementById('submit').click();"; | 2925 "document.getElementById('submit').click();"; |
2925 VerifyPasswordIsSavedAndFilled( | 2926 VerifyPasswordIsSavedAndFilled( |
2926 "/password/password_autocomplete_off_test.html", submit, "password", | 2927 "/password/password_autocomplete_off_test.html", submit, "password", |
2927 "mypassword"); | 2928 "mypassword"); |
2928 } | 2929 } |
2929 | 2930 |
2930 } // namespace password_manager | 2931 } // namespace password_manager |
OLD | NEW |