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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // TODO(ericu): The vast majority of this and the other FSFU subclass tests | 114 // TODO(ericu): The vast majority of this and the other FSFU subclass tests |
115 // could theoretically be shared. It would basically be a FSFU interface | 115 // could theoretically be shared. It would basically be a FSFU interface |
116 // compliance test, and only the subclass-specific bits that look into the | 116 // compliance test, and only the subclass-specific bits that look into the |
117 // implementation would need to be written per-subclass. | 117 // implementation would need to be written per-subclass. |
118 class ObfuscatedFileUtilTest : public testing::Test { | 118 class ObfuscatedFileUtilTest : public testing::Test { |
119 public: | 119 public: |
120 ObfuscatedFileUtilTest() | 120 ObfuscatedFileUtilTest() |
121 : origin_(GURL("http://www.example.com")), | 121 : origin_(GURL("http://www.example.com")), |
122 type_(kFileSystemTypeTemporary), | 122 type_(kFileSystemTypeTemporary), |
123 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 123 weak_factory_(this), |
124 test_helper_(origin_, type_), | 124 test_helper_(origin_, type_), |
125 quota_status_(quota::kQuotaStatusUnknown), | 125 quota_status_(quota::kQuotaStatusUnknown), |
126 usage_(-1) { | 126 usage_(-1) { |
127 } | 127 } |
128 | 128 |
129 virtual void SetUp() { | 129 virtual void SetUp() { |
130 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 130 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
131 | 131 |
132 scoped_refptr<quota::SpecialStoragePolicy> storage_policy = | 132 scoped_refptr<quota::SpecialStoragePolicy> storage_policy = |
133 new quota::MockSpecialStoragePolicy(); | 133 new quota::MockSpecialStoragePolicy(); |
(...skipping 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2244 ASSERT_EQ(base::PLATFORM_FILE_OK, | 2244 ASSERT_EQ(base::PLATFORM_FILE_OK, |
2245 ofu()->CreateOrOpen( | 2245 ofu()->CreateOrOpen( |
2246 AllowUsageIncrease(-length)->context(), file, | 2246 AllowUsageIncrease(-length)->context(), file, |
2247 base::PLATFORM_FILE_OPEN_TRUNCATED | base::PLATFORM_FILE_WRITE, | 2247 base::PLATFORM_FILE_OPEN_TRUNCATED | base::PLATFORM_FILE_WRITE, |
2248 &file_handle, &created)); | 2248 &file_handle, &created)); |
2249 ASSERT_EQ(0, ComputeTotalFileSize()); | 2249 ASSERT_EQ(0, ComputeTotalFileSize()); |
2250 EXPECT_TRUE(base::ClosePlatformFile(file_handle)); | 2250 EXPECT_TRUE(base::ClosePlatformFile(file_handle)); |
2251 } | 2251 } |
2252 | 2252 |
2253 } // namespace fileapi | 2253 } // namespace fileapi |
OLD | NEW |