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 "webkit/browser/fileapi/quota/quota_backend_impl.h" | 5 #include "webkit/browser/fileapi/quota/quota_backend_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "third_party/leveldatabase/src/helpers/memenv/memenv.h" | 12 #include "third_party/leveldatabase/src/helpers/memenv/memenv.h" |
13 #include "third_party/leveldatabase/src/include/leveldb/env.h" | 13 #include "third_party/leveldatabase/src/include/leveldb/env.h" |
14 #include "webkit/browser/fileapi/file_system_usage_cache.h" | 14 #include "webkit/browser/fileapi/file_system_usage_cache.h" |
15 #include "webkit/browser/fileapi/obfuscated_file_util.h" | 15 #include "webkit/browser/fileapi/obfuscated_file_util.h" |
16 #include "webkit/browser/quota/quota_manager_proxy.h" | 16 #include "webkit/browser/quota/quota_manager_proxy.h" |
17 | 17 |
18 namespace fileapi { | 18 using fileapi::FileSystemType; |
| 19 using fileapi::FileSystemUsageCache; |
| 20 using fileapi::ObfuscatedFileUtil; |
| 21 using fileapi::QuotaBackendImpl; |
| 22 using fileapi::SandboxFileSystemBackendDelegate; |
| 23 |
| 24 namespace content { |
19 | 25 |
20 namespace { | 26 namespace { |
21 | 27 |
22 const char kOrigin[] = "http://example.com"; | 28 const char kOrigin[] = "http://example.com"; |
23 | 29 |
24 bool DidReserveQuota(bool accepted, | 30 bool DidReserveQuota(bool accepted, |
25 base::File::Error* error_out, | 31 base::File::Error* error_out, |
26 int64* delta_out, | 32 int64* delta_out, |
27 base::File::Error error, | 33 base::File::Error error, |
28 int64 delta) { | 34 int64 delta) { |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 backend_->IncrementDirtyCount(GURL(kOrigin), type); | 262 backend_->IncrementDirtyCount(GURL(kOrigin), type); |
257 uint32 dirty = 0; | 263 uint32 dirty = 0; |
258 ASSERT_TRUE(file_system_usage_cache_.GetDirty(path, &dirty)); | 264 ASSERT_TRUE(file_system_usage_cache_.GetDirty(path, &dirty)); |
259 EXPECT_EQ(1u, dirty); | 265 EXPECT_EQ(1u, dirty); |
260 | 266 |
261 backend_->DecrementDirtyCount(GURL(kOrigin), type); | 267 backend_->DecrementDirtyCount(GURL(kOrigin), type); |
262 ASSERT_TRUE(file_system_usage_cache_.GetDirty(path, &dirty)); | 268 ASSERT_TRUE(file_system_usage_cache_.GetDirty(path, &dirty)); |
263 EXPECT_EQ(0u, dirty); | 269 EXPECT_EQ(0u, dirty); |
264 } | 270 } |
265 | 271 |
266 } // namespace fileapi | 272 } // namespace content |
OLD | NEW |