OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/fileapi/sandbox_mount_point_provider.h" | 5 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 SandboxMountPointProvider::OriginEnumerator* enumerator() const { | 41 SandboxMountPointProvider::OriginEnumerator* enumerator() const { |
42 return enumerator_.get(); | 42 return enumerator_.get(); |
43 } | 43 } |
44 | 44 |
45 protected: | 45 protected: |
46 void CreateOriginTypeDirectory(const GURL& origin, | 46 void CreateOriginTypeDirectory(const GURL& origin, |
47 fileapi::FileSystemType type) { | 47 fileapi::FileSystemType type) { |
48 FilePath target = path_manager_->sandbox_provider()-> | 48 FilePath target = path_manager_->sandbox_provider()-> |
49 GetBaseDirectoryForOriginAndType(origin, type); | 49 GetBaseDirectoryForOriginAndType(origin, type, true); |
50 file_util::CreateDirectory(target); | 50 file_util::CreateDirectory(target); |
51 ASSERT_TRUE(file_util::DirectoryExists(target)); | 51 ASSERT_TRUE(file_util::DirectoryExists(target)); |
52 } | 52 } |
53 | 53 |
54 ScopedTempDir data_dir_; | 54 ScopedTempDir data_dir_; |
55 scoped_ptr<FileSystemPathManager> path_manager_; | 55 scoped_ptr<FileSystemPathManager> path_manager_; |
56 scoped_ptr<SandboxMountPointProvider::OriginEnumerator> enumerator_; | 56 scoped_ptr<SandboxMountPointProvider::OriginEnumerator> enumerator_; |
57 }; | 57 }; |
58 | 58 |
59 TEST_F(SandboxMountPointProviderOriginEnumeratorTest, Empty) { | 59 TEST_F(SandboxMountPointProviderOriginEnumeratorTest, Empty) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 ASSERT_TRUE(persistent_set.find(current) != persistent_set.end()); | 100 ASSERT_TRUE(persistent_set.find(current) != persistent_set.end()); |
101 ++persistent_actual_size; | 101 ++persistent_actual_size; |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 ASSERT_EQ(temporary_size, temporary_actual_size); | 105 ASSERT_EQ(temporary_size, temporary_actual_size); |
106 ASSERT_EQ(persistent_size, persistent_actual_size); | 106 ASSERT_EQ(persistent_size, persistent_actual_size); |
107 } | 107 } |
108 | 108 |
109 } // namespace fileapi | 109 } // namespace fileapi |
OLD | NEW |