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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 if (request.relative_url == gaia->client_login_to_oauth2_url().path() || | 170 if (request.relative_url == gaia->client_login_to_oauth2_url().path() || |
171 request.relative_url == gaia->oauth2_token_url().path() || | 171 request.relative_url == gaia->oauth2_token_url().path() || |
172 request.relative_url.find(kDMRegisterRequest) == 0 || | 172 request.relative_url.find(kDMRegisterRequest) == 0 || |
173 request.relative_url.find(kDMPolicyRequest) == 0) { | 173 request.relative_url.find(kDMPolicyRequest) == 0) { |
174 if (!responses_.empty()) { | 174 if (!responses_.empty()) { |
175 response.reset(responses_.back()); | 175 response.reset(responses_.back()); |
176 responses_.pop_back(); | 176 responses_.pop_back(); |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 return response.Pass(); | 180 return response; |
181 } | 181 } |
182 | 182 |
183 // Creates a new canned response that will respond with the given HTTP | 183 // Creates a new canned response that will respond with the given HTTP |
184 // status |code|. That response is appended to |responses_| and will be the | 184 // status |code|. That response is appended to |responses_| and will be the |
185 // next response used. | 185 // next response used. |
186 // Returns a reference to that response, so that it can be further customized. | 186 // Returns a reference to that response, so that it can be further customized. |
187 net::test_server::BasicHttpResponse& PushResponse(net::HttpStatusCode code) { | 187 net::test_server::BasicHttpResponse& PushResponse(net::HttpStatusCode code) { |
188 net::test_server::BasicHttpResponse* response = | 188 net::test_server::BasicHttpResponse* response = |
189 new net::test_server::BasicHttpResponse(); | 189 new net::test_server::BasicHttpResponse(); |
190 response->set_code(code); | 190 response->set_code(code); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 {3, kUsernameOtherDomain, true}, | 320 {3, kUsernameOtherDomain, true}, |
321 {4, kUsernameOtherDomain, true}, | 321 {4, kUsernameOtherDomain, true}, |
322 {5, kUsernameOtherDomain, true}, | 322 {5, kUsernameOtherDomain, true}, |
323 }; | 323 }; |
324 | 324 |
325 INSTANTIATE_TEST_CASE_P(BlockingLoginTestInstance, | 325 INSTANTIATE_TEST_CASE_P(BlockingLoginTestInstance, |
326 BlockingLoginTest, | 326 BlockingLoginTest, |
327 testing::ValuesIn(kBlockinLoginTestCases)); | 327 testing::ValuesIn(kBlockinLoginTestCases)); |
328 | 328 |
329 } // namespace chromeos | 329 } // namespace chromeos |
OLD | NEW |