OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <stack> | 5 #include <stack> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 Method method_; | 122 Method method_; |
123 }; | 123 }; |
124 | 124 |
125 void SetUp() { | 125 void SetUp() { |
126 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 126 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
127 | 127 |
128 temp_file1_ = temp_dir_.path().AppendASCII("BlobFile1.dat"); | 128 temp_file1_ = temp_dir_.path().AppendASCII("BlobFile1.dat"); |
129 ASSERT_EQ(static_cast<int>(arraysize(kTestFileData1) - 1), | 129 ASSERT_EQ(static_cast<int>(arraysize(kTestFileData1) - 1), |
130 file_util::WriteFile(temp_file1_, kTestFileData1, | 130 file_util::WriteFile(temp_file1_, kTestFileData1, |
131 arraysize(kTestFileData1) - 1)); | 131 arraysize(kTestFileData1) - 1)); |
132 file_util::FileInfo file_info1; | 132 base::PlatformFileInfo file_info1; |
133 file_util::GetFileInfo(temp_file1_, &file_info1); | 133 file_util::GetFileInfo(temp_file1_, &file_info1); |
134 temp_file_modification_time1_ = file_info1.last_modified; | 134 temp_file_modification_time1_ = file_info1.last_modified; |
135 | 135 |
136 temp_file2_ = temp_dir_.path().AppendASCII("BlobFile2.dat"); | 136 temp_file2_ = temp_dir_.path().AppendASCII("BlobFile2.dat"); |
137 ASSERT_EQ(static_cast<int>(arraysize(kTestFileData2) - 1), | 137 ASSERT_EQ(static_cast<int>(arraysize(kTestFileData2) - 1), |
138 file_util::WriteFile(temp_file2_, kTestFileData2, | 138 file_util::WriteFile(temp_file2_, kTestFileData2, |
139 arraysize(kTestFileData2) - 1)); | 139 arraysize(kTestFileData2) - 1)); |
140 file_util::FileInfo file_info2; | 140 base::PlatformFileInfo file_info2; |
141 file_util::GetFileInfo(temp_file2_, &file_info2); | 141 file_util::GetFileInfo(temp_file2_, &file_info2); |
142 temp_file_modification_time2_ = file_info2.last_modified; | 142 temp_file_modification_time2_ = file_info2.last_modified; |
143 | 143 |
144 io_thread_.reset(new base::Thread("BlobRLRequestJobTest Thread")); | 144 io_thread_.reset(new base::Thread("BlobRLRequestJobTest Thread")); |
145 base::Thread::Options options(MessageLoop::TYPE_IO, 0); | 145 base::Thread::Options options(MessageLoop::TYPE_IO, 0); |
146 io_thread_->StartWithOptions(options); | 146 io_thread_->StartWithOptions(options); |
147 } | 147 } |
148 | 148 |
149 void TearDown() { | 149 void TearDown() { |
150 io_thread_.reset(NULL); | 150 io_thread_.reset(NULL); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 | 439 |
440 TEST_F(BlobURLRequestJobTest, TestExtraHeaders) { | 440 TEST_F(BlobURLRequestJobTest, TestExtraHeaders) { |
441 RunTestOnIOThread(&BlobURLRequestJobTest::TestExtraHeaders); | 441 RunTestOnIOThread(&BlobURLRequestJobTest::TestExtraHeaders); |
442 } | 442 } |
443 | 443 |
444 } // namespace webkit_blob | 444 } // namespace webkit_blob |
445 | 445 |
446 // BlobURLRequestJobTest is expected to always live longer than the | 446 // BlobURLRequestJobTest is expected to always live longer than the |
447 // runnable methods. This lets us call NewRunnableMethod on its instances. | 447 // runnable methods. This lets us call NewRunnableMethod on its instances. |
448 DISABLE_RUNNABLE_METHOD_REFCOUNT(webkit_blob::BlobURLRequestJobTest); | 448 DISABLE_RUNNABLE_METHOD_REFCOUNT(webkit_blob::BlobURLRequestJobTest); |
OLD | NEW |