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 "webkit/browser/fileapi/sandbox_file_system_backend.h" | 5 #include "webkit/browser/fileapi/sandbox_file_system_backend.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 virtual void SetUp() { | 86 virtual void SetUp() { |
87 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 87 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
88 context_.reset(new SandboxContext( | 88 context_.reset(new SandboxContext( |
89 NULL /* quota_manager_proxy */, | 89 NULL /* quota_manager_proxy */, |
90 base::MessageLoopProxy::current().get(), | 90 base::MessageLoopProxy::current().get(), |
91 data_dir_.path(), | 91 data_dir_.path(), |
92 NULL /* special_storage_policy */)); | 92 NULL /* special_storage_policy */)); |
93 } | 93 } |
94 | 94 |
95 void SetUpNewBackend(const FileSystemOptions& options) { | 95 void SetUpNewBackend(const FileSystemOptions& options) { |
96 backend_.reset(new SandboxFileSystemBackend(context_.get(), options)); | 96 backend_.reset(new SandboxFileSystemBackend( |
| 97 context_.get(), |
| 98 base::MessageLoopProxy::current().get(), |
| 99 options)); |
97 } | 100 } |
98 | 101 |
99 SandboxFileSystemBackend::OriginEnumerator* CreateOriginEnumerator() const { | 102 SandboxFileSystemBackend::OriginEnumerator* CreateOriginEnumerator() const { |
100 return backend_->CreateOriginEnumerator(); | 103 return backend_->CreateOriginEnumerator(); |
101 } | 104 } |
102 | 105 |
103 void CreateOriginTypeDirectory(const GURL& origin, | 106 void CreateOriginTypeDirectory(const GURL& origin, |
104 fileapi::FileSystemType type) { | 107 fileapi::FileSystemType type) { |
105 base::FilePath target = backend_-> | 108 base::FilePath target = backend_-> |
106 GetBaseDirectoryForOriginAndType(origin, type, true); | 109 GetBaseDirectoryForOriginAndType(origin, type, true); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, | 354 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, |
352 &root_path)); | 355 &root_path)); |
353 base::FilePath expected = file_system_path().AppendASCII( | 356 base::FilePath expected = file_system_path().AppendASCII( |
354 kRootPathFileURITestCases[i].expected_path); | 357 kRootPathFileURITestCases[i].expected_path); |
355 EXPECT_EQ(expected.value(), root_path.value()); | 358 EXPECT_EQ(expected.value(), root_path.value()); |
356 EXPECT_TRUE(base::DirectoryExists(root_path)); | 359 EXPECT_TRUE(base::DirectoryExists(root_path)); |
357 } | 360 } |
358 } | 361 } |
359 | 362 |
360 } // namespace fileapi | 363 } // namespace fileapi |
OLD | NEW |