Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: webkit/blob/blob_url_request_job_unittest.cc

Issue 3347005: Moving file_util::FileInfo to base::PlatformFileInfo, and adding the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698