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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 net::URLRequestJob* FileWriterDelegateTest::Factory( | 190 net::URLRequestJob* FileWriterDelegateTest::Factory( |
191 net::URLRequest* request, | 191 net::URLRequest* request, |
192 net::NetworkDelegate* network_delegate, | 192 net::NetworkDelegate* network_delegate, |
193 const std::string& scheme) { | 193 const std::string& scheme) { |
194 return new FileWriterDelegateTestJob( | 194 return new FileWriterDelegateTestJob( |
195 request, network_delegate, FileWriterDelegateTest::content_); | 195 request, network_delegate, FileWriterDelegateTest::content_); |
196 } | 196 } |
197 | 197 |
198 void FileWriterDelegateTest::SetUp() { | 198 void FileWriterDelegateTest::SetUp() { |
199 ASSERT_TRUE(dir_.CreateUniqueTempDir()); | 199 ASSERT_TRUE(dir_.CreateUniqueTempDir()); |
200 FilePath base_dir = dir_.path().AppendASCII("filesystem"); | 200 base::FilePath base_dir = dir_.path().AppendASCII("filesystem"); |
201 test_helper_.SetUp(base_dir); | 201 test_helper_.SetUp(base_dir); |
202 | 202 |
203 scoped_ptr<FileSystemOperationContext> context( | 203 scoped_ptr<FileSystemOperationContext> context( |
204 test_helper_.NewOperationContext()); | 204 test_helper_.NewOperationContext()); |
205 context->set_allowed_bytes_growth(kint64max); | 205 context->set_allowed_bytes_growth(kint64max); |
206 bool created = false; | 206 bool created = false; |
207 base::PlatformFileError error = file_util()->EnsureFileExists( | 207 base::PlatformFileError error = file_util()->EnsureFileExists( |
208 context.get(), | 208 context.get(), |
209 GetFileSystemURL("test"), | 209 GetFileSystemURL("test"), |
210 &created); | 210 &created); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 file_writer_delegate_.reset(); | 458 file_writer_delegate_.reset(); |
459 | 459 |
460 EXPECT_EQ(pre_write_usage + allowed_growth, | 460 EXPECT_EQ(pre_write_usage + allowed_growth, |
461 test_helper_.GetCachedOriginUsage()); | 461 test_helper_.GetCachedOriginUsage()); |
462 EXPECT_EQ(ComputeCurrentOriginUsage(), test_helper_.GetCachedOriginUsage()); | 462 EXPECT_EQ(ComputeCurrentOriginUsage(), test_helper_.GetCachedOriginUsage()); |
463 EXPECT_EQ(kOverlap + allowed_growth, result_->bytes_written()); | 463 EXPECT_EQ(kOverlap + allowed_growth, result_->bytes_written()); |
464 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, result_->status()); | 464 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, result_->status()); |
465 } | 465 } |
466 | 466 |
467 } // namespace fileapi | 467 } // namespace fileapi |
OLD | NEW |