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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 scoped_refptr<net::IOBuffer> received_data_; | 110 scoped_refptr<net::IOBuffer> received_data_; |
111 std::string response_data_; | 111 std::string response_data_; |
112 }; | 112 }; |
113 | 113 |
114 // A simple ProtocolHandler implementation to create BlobURLRequestJob. | 114 // A simple ProtocolHandler implementation to create BlobURLRequestJob. |
115 class MockProtocolHandler : | 115 class MockProtocolHandler : |
116 public net::URLRequestJobFactory::ProtocolHandler { | 116 public net::URLRequestJobFactory::ProtocolHandler { |
117 public: | 117 public: |
118 MockProtocolHandler(BlobURLRequestJobTest* test) : test_(test) {} | 118 explicit MockProtocolHandler(BlobURLRequestJobTest* test) : test_(test) {} |
119 | 119 |
120 // net::URLRequestJobFactory::ProtocolHandler override. | 120 // net::URLRequestJobFactory::ProtocolHandler override. |
121 virtual net::URLRequestJob* MaybeCreateJob( | 121 virtual net::URLRequestJob* MaybeCreateJob( |
122 net::URLRequest* request, | 122 net::URLRequest* request, |
123 net::NetworkDelegate* network_delegate) const OVERRIDE { | 123 net::NetworkDelegate* network_delegate) const OVERRIDE { |
124 return new BlobURLRequestJob(request, | 124 return new BlobURLRequestJob(request, |
125 network_delegate, | 125 network_delegate, |
126 test_->blob_data_, | 126 test_->blob_data_, |
127 test_->file_system_context_, | 127 test_->file_system_context_, |
128 base::MessageLoopProxy::current()); | 128 base::MessageLoopProxy::current()); |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); | 445 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); |
446 EXPECT_EQ(kTestContentType, content_type); | 446 EXPECT_EQ(kTestContentType, content_type); |
447 void* iter = NULL; | 447 void* iter = NULL; |
448 std::string content_disposition; | 448 std::string content_disposition; |
449 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( | 449 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( |
450 &iter, "Content-Disposition", &content_disposition)); | 450 &iter, "Content-Disposition", &content_disposition)); |
451 EXPECT_EQ(kTestContentDisposition, content_disposition); | 451 EXPECT_EQ(kTestContentDisposition, content_disposition); |
452 } | 452 } |
453 | 453 |
454 } // namespace webkit_blob | 454 } // namespace webkit_blob |
OLD | NEW |