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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 public: | 56 public: |
57 // A simple ProtocolHandler implementation to create BlobURLRequestJob. | 57 // A simple ProtocolHandler implementation to create BlobURLRequestJob. |
58 class MockProtocolHandler : | 58 class MockProtocolHandler : |
59 public net::URLRequestJobFactory::ProtocolHandler { | 59 public net::URLRequestJobFactory::ProtocolHandler { |
60 public: | 60 public: |
61 MockProtocolHandler(BlobURLRequestJobTest* test) : test_(test) {} | 61 MockProtocolHandler(BlobURLRequestJobTest* test) : test_(test) {} |
62 | 62 |
63 // net::URLRequestJobFactory::ProtocolHandler override. | 63 // net::URLRequestJobFactory::ProtocolHandler override. |
64 virtual net::URLRequestJob* MaybeCreateJob( | 64 virtual net::URLRequestJob* MaybeCreateJob( |
65 net::URLRequest* request, | 65 net::URLRequest* request, |
66 net::NetworkDelegate* network_delegate) const OVERRIDE { | 66 net::NetworkDelegate* network_delegate) const override { |
67 return new BlobURLRequestJob(request, | 67 return new BlobURLRequestJob(request, |
68 network_delegate, | 68 network_delegate, |
69 test_->blob_data_.get(), | 69 test_->blob_data_.get(), |
70 test_->file_system_context_.get(), | 70 test_->file_system_context_.get(), |
71 base::MessageLoopProxy::current().get()); | 71 base::MessageLoopProxy::current().get()); |
72 } | 72 } |
73 | 73 |
74 private: | 74 private: |
75 BlobURLRequestJobTest* test_; | 75 BlobURLRequestJobTest* test_; |
76 }; | 76 }; |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); | 408 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); |
409 EXPECT_EQ(kTestContentType, content_type); | 409 EXPECT_EQ(kTestContentType, content_type); |
410 void* iter = NULL; | 410 void* iter = NULL; |
411 std::string content_disposition; | 411 std::string content_disposition; |
412 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( | 412 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( |
413 &iter, "Content-Disposition", &content_disposition)); | 413 &iter, "Content-Disposition", &content_disposition)); |
414 EXPECT_EQ(kTestContentDisposition, content_disposition); | 414 EXPECT_EQ(kTestContentDisposition, content_disposition); |
415 } | 415 } |
416 | 416 |
417 } // namespace content | 417 } // namespace content |
OLD | NEW |