| 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_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 test_->file_system_context_, | 129 test_->file_system_context_, |
| 130 base::MessageLoopProxy::current()); | 130 base::MessageLoopProxy::current()); |
| 131 } | 131 } |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 BlobURLRequestJobTest* test_; | 134 BlobURLRequestJobTest* test_; |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 BlobURLRequestJobTest() | 137 BlobURLRequestJobTest() |
| 138 : message_loop_(MessageLoop::TYPE_IO), | 138 : message_loop_(MessageLoop::TYPE_IO), |
| 139 blob_data_(new BlobData()), | 139 blob_data_(new BlobData("id")), |
| 140 expected_status_code_(0) { | 140 expected_status_code_(0) { |
| 141 } | 141 } |
| 142 | 142 |
| 143 virtual void SetUp() { | 143 virtual void SetUp() { |
| 144 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 144 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 145 | 145 |
| 146 temp_file1_ = temp_dir_.path().AppendASCII("BlobFile1.dat"); | 146 temp_file1_ = temp_dir_.path().AppendASCII("BlobFile1.dat"); |
| 147 ASSERT_EQ(static_cast<int>(arraysize(kTestFileData1) - 1), | 147 ASSERT_EQ(static_cast<int>(arraysize(kTestFileData1) - 1), |
| 148 file_util::WriteFile(temp_file1_, kTestFileData1, | 148 file_util::WriteFile(temp_file1_, kTestFileData1, |
| 149 arraysize(kTestFileData1) - 1)); | 149 arraysize(kTestFileData1) - 1)); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); | 450 EXPECT_TRUE(request_->response_headers()->GetMimeType(&content_type)); |
| 451 EXPECT_EQ(kTestContentType, content_type); | 451 EXPECT_EQ(kTestContentType, content_type); |
| 452 void* iter = NULL; | 452 void* iter = NULL; |
| 453 std::string content_disposition; | 453 std::string content_disposition; |
| 454 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( | 454 EXPECT_TRUE(request_->response_headers()->EnumerateHeader( |
| 455 &iter, "Content-Disposition", &content_disposition)); | 455 &iter, "Content-Disposition", &content_disposition)); |
| 456 EXPECT_EQ(kTestContentDisposition, content_disposition); | 456 EXPECT_EQ(kTestContentDisposition, content_disposition); |
| 457 } | 457 } |
| 458 | 458 |
| 459 } // namespace webkit_blob | 459 } // namespace webkit_blob |
| OLD | NEW |