| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "storage/browser/fileapi/file_system_usage_cache.h" | 5 #include "storage/browser/fileapi/file_system_usage_cache.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 class FileSystemUsageCacheTest : public testing::Test { | 22 class FileSystemUsageCacheTest : public testing::Test { |
| 23 public: | 23 public: |
| 24 FileSystemUsageCacheTest() | 24 FileSystemUsageCacheTest() |
| 25 : usage_cache_(base::ThreadTaskRunnerHandle::Get().get()) {} | 25 : usage_cache_(base::ThreadTaskRunnerHandle::Get().get()) {} |
| 26 | 26 |
| 27 void SetUp() override { ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); } | 27 void SetUp() override { ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); } |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 base::FilePath GetUsageFilePath() { | 30 base::FilePath GetUsageFilePath() { |
| 31 return data_dir_.path().Append(FileSystemUsageCache::kUsageFileName); | 31 return data_dir_.GetPath().Append(FileSystemUsageCache::kUsageFileName); |
| 32 } | 32 } |
| 33 | 33 |
| 34 FileSystemUsageCache* usage_cache() { | 34 FileSystemUsageCache* usage_cache() { |
| 35 return &usage_cache_; | 35 return &usage_cache_; |
| 36 } | 36 } |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 base::MessageLoop message_loop_; | 39 base::MessageLoop message_loop_; |
| 40 base::ScopedTempDir data_dir_; | 40 base::ScopedTempDir data_dir_; |
| 41 FileSystemUsageCache usage_cache_; | 41 FileSystemUsageCache usage_cache_; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 base::FilePath usage_file_path = GetUsageFilePath(); | 154 base::FilePath usage_file_path = GetUsageFilePath(); |
| 155 EXPECT_FALSE(usage_cache()->IncrementDirty(usage_file_path)); | 155 EXPECT_FALSE(usage_cache()->IncrementDirty(usage_file_path)); |
| 156 } | 156 } |
| 157 | 157 |
| 158 TEST_F(FileSystemUsageCacheTest, DecrementDirtyWithoutCacheFileTest) { | 158 TEST_F(FileSystemUsageCacheTest, DecrementDirtyWithoutCacheFileTest) { |
| 159 base::FilePath usage_file_path = GetUsageFilePath(); | 159 base::FilePath usage_file_path = GetUsageFilePath(); |
| 160 EXPECT_FALSE(usage_cache()->IncrementDirty(usage_file_path)); | 160 EXPECT_FALSE(usage_cache()->IncrementDirty(usage_file_path)); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace content | 163 } // namespace content |
| OLD | NEW |