| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 using storage::FileWriterDelegate; | 32 using storage::FileWriterDelegate; |
| 33 | 33 |
| 34 namespace content { | 34 namespace content { |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 const GURL kOrigin("http://example.com"); | 38 const GURL kOrigin("http://example.com"); |
| 39 const storage::FileSystemType kFileSystemType = storage::kFileSystemTypeTest; | 39 const storage::FileSystemType kFileSystemType = storage::kFileSystemTypeTest; |
| 40 | 40 |
| 41 const char kData[] = "The quick brown fox jumps over the lazy dog.\n"; | 41 const char kData[] = "The quick brown fox jumps over the lazy dog.\n"; |
| 42 const int kDataSize = ARRAYSIZE_UNSAFE(kData) - 1; | 42 const int kDataSize = arraysize(kData) - 1; |
| 43 | 43 |
| 44 class Result { | 44 class Result { |
| 45 public: | 45 public: |
| 46 Result() | 46 Result() |
| 47 : status_(base::File::FILE_OK), | 47 : status_(base::File::FILE_OK), |
| 48 bytes_written_(0), | 48 bytes_written_(0), |
| 49 write_status_(FileWriterDelegate::SUCCESS_IO_PENDING) {} | 49 write_status_(FileWriterDelegate::SUCCESS_IO_PENDING) {} |
| 50 | 50 |
| 51 base::File::Error status() const { return status_; } | 51 base::File::Error status() const { return status_; } |
| 52 int64 bytes_written() const { return bytes_written_; } | 52 int64 bytes_written() const { return bytes_written_; } |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 file_writer_delegate_.reset(); | 477 file_writer_delegate_.reset(); |
| 478 | 478 |
| 479 EXPECT_EQ(pre_write_usage + allowed_growth, usage()); | 479 EXPECT_EQ(pre_write_usage + allowed_growth, usage()); |
| 480 EXPECT_EQ(GetFileSizeOnDisk("test"), usage()); | 480 EXPECT_EQ(GetFileSizeOnDisk("test"), usage()); |
| 481 EXPECT_EQ(kOverlap + allowed_growth, result.bytes_written()); | 481 EXPECT_EQ(kOverlap + allowed_growth, result.bytes_written()); |
| 482 EXPECT_EQ(base::File::FILE_ERROR_NO_SPACE, result.status()); | 482 EXPECT_EQ(base::File::FILE_ERROR_NO_SPACE, result.status()); |
| 483 } | 483 } |
| 484 } | 484 } |
| 485 | 485 |
| 486 } // namespace content | 486 } // namespace content |
| OLD | NEW |