| 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 "net/test/embedded_test_server/embedded_test_server.h" | 5 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 namespace test_server { | 25 namespace test_server { |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 class CustomHttpResponse : public HttpResponse { | 29 class CustomHttpResponse : public HttpResponse { |
| 30 public: | 30 public: |
| 31 CustomHttpResponse(const std::string& headers, const std::string& contents) | 31 CustomHttpResponse(const std::string& headers, const std::string& contents) |
| 32 : headers_(headers), contents_(contents) { | 32 : headers_(headers), contents_(contents) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 virtual std::string ToResponseString() const OVERRIDE { | 35 virtual std::string ToResponseString() const override { |
| 36 return headers_ + "\r\n" + contents_; | 36 return headers_ + "\r\n" + contents_; |
| 37 } | 37 } |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 std::string headers_; | 40 std::string headers_; |
| 41 std::string contents_; | 41 std::string contents_; |
| 42 | 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(CustomHttpResponse); | 43 DISALLOW_COPY_AND_ASSIGN(CustomHttpResponse); |
| 44 }; | 44 }; |
| 45 | 45 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 FROM_HERE, closure, run_loop.QuitClosure())) { | 339 FROM_HERE, closure, run_loop.QuitClosure())) { |
| 340 return false; | 340 return false; |
| 341 } | 341 } |
| 342 run_loop.Run(); | 342 run_loop.Run(); |
| 343 | 343 |
| 344 return true; | 344 return true; |
| 345 } | 345 } |
| 346 | 346 |
| 347 } // namespace test_server | 347 } // namespace test_server |
| 348 } // namespace net | 348 } // namespace net |
| OLD | NEW |