OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/test/browser_test_utils.h" | 5 #include "content/public/test/browser_test_utils.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 // Append the real part of the path to the new URL. | 251 // Append the real part of the path to the new URL. |
252 std::string path = params.substr(slash + 1); | 252 std::string path = params.substr(slash + 1); |
253 GURL redirect_target(redirect_server.Resolve(path)); | 253 GURL redirect_target(redirect_server.Resolve(path)); |
254 DCHECK(redirect_target.is_valid()); | 254 DCHECK(redirect_target.is_valid()); |
255 | 255 |
256 scoped_ptr<net::test_server::BasicHttpResponse> http_response( | 256 scoped_ptr<net::test_server::BasicHttpResponse> http_response( |
257 new net::test_server::BasicHttpResponse); | 257 new net::test_server::BasicHttpResponse); |
258 http_response->set_code(net::HTTP_MOVED_PERMANENTLY); | 258 http_response->set_code(net::HTTP_MOVED_PERMANENTLY); |
259 http_response->AddCustomHeader("Location", redirect_target.spec()); | 259 http_response->AddCustomHeader("Location", redirect_target.spec()); |
260 return http_response.PassAs<net::test_server::HttpResponse>(); | 260 return http_response.Pass(); |
261 } | 261 } |
262 | 262 |
263 } // namespace | 263 } // namespace |
264 | 264 |
265 | 265 |
266 GURL GetFileUrlWithQuery(const base::FilePath& path, | 266 GURL GetFileUrlWithQuery(const base::FilePath& path, |
267 const std::string& query_string) { | 267 const std::string& query_string) { |
268 GURL url = net::FilePathToFileURL(path); | 268 GURL url = net::FilePathToFileURL(path); |
269 if (!query_string.empty()) { | 269 if (!query_string.empty()) { |
270 GURL::Replacements replacements; | 270 GURL::Replacements replacements; |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 } | 824 } |
825 // The queue should not be empty, unless we were quit because of a timeout. | 825 // The queue should not be empty, unless we were quit because of a timeout. |
826 if (message_queue_.empty()) | 826 if (message_queue_.empty()) |
827 return false; | 827 return false; |
828 *message = message_queue_.front(); | 828 *message = message_queue_.front(); |
829 message_queue_.pop(); | 829 message_queue_.pop(); |
830 return true; | 830 return true; |
831 } | 831 } |
832 | 832 |
833 } // namespace content | 833 } // namespace content |
OLD | NEW |