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/file_system_context.h" | 5 #include "webkit/browser/fileapi/file_system_context.h" |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "content/browser/quota/mock_quota_manager.h" | 10 #include "content/browser/quota/mock_quota_manager.h" |
| 11 #include "content/public/test/mock_special_storage_policy.h" |
11 #include "content/public/test/test_file_system_options.h" | 12 #include "content/public/test/test_file_system_options.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "webkit/browser/fileapi/external_mount_points.h" | 14 #include "webkit/browser/fileapi/external_mount_points.h" |
14 #include "webkit/browser/fileapi/file_system_backend.h" | 15 #include "webkit/browser/fileapi/file_system_backend.h" |
15 #include "webkit/browser/fileapi/isolated_context.h" | 16 #include "webkit/browser/fileapi/isolated_context.h" |
16 #include "webkit/browser/quota/mock_special_storage_policy.h" | |
17 | 17 |
18 #define FPL(x) FILE_PATH_LITERAL(x) | 18 #define FPL(x) FILE_PATH_LITERAL(x) |
19 | 19 |
20 #if defined(FILE_PATH_USES_DRIVE_LETTERS) | 20 #if defined(FILE_PATH_USES_DRIVE_LETTERS) |
21 #define DRIVE FPL("C:") | 21 #define DRIVE FPL("C:") |
22 #else | 22 #else |
23 #define DRIVE | 23 #define DRIVE |
24 #endif | 24 #endif |
25 | 25 |
26 using fileapi::ExternalMountPoints; | 26 using fileapi::ExternalMountPoints; |
(...skipping 19 matching lines...) Expand all Loading... |
46 return GURL(url_str); | 46 return GURL(url_str); |
47 } | 47 } |
48 | 48 |
49 class FileSystemContextTest : public testing::Test { | 49 class FileSystemContextTest : public testing::Test { |
50 public: | 50 public: |
51 FileSystemContextTest() {} | 51 FileSystemContextTest() {} |
52 | 52 |
53 virtual void SetUp() { | 53 virtual void SetUp() { |
54 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 54 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
55 | 55 |
56 storage_policy_ = new quota::MockSpecialStoragePolicy(); | 56 storage_policy_ = new MockSpecialStoragePolicy(); |
57 | 57 |
58 mock_quota_manager_ = | 58 mock_quota_manager_ = |
59 new MockQuotaManager(false /* is_incognito */, | 59 new MockQuotaManager(false /* is_incognito */, |
60 data_dir_.path(), | 60 data_dir_.path(), |
61 base::MessageLoopProxy::current().get(), | 61 base::MessageLoopProxy::current().get(), |
62 base::MessageLoopProxy::current().get(), | 62 base::MessageLoopProxy::current().get(), |
63 storage_policy_.get()); | 63 storage_policy_.get()); |
64 } | 64 } |
65 | 65 |
66 protected: | 66 protected: |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 EXPECT_TRUE(context->CanServeURLRequest(cracked_url)); | 377 EXPECT_TRUE(context->CanServeURLRequest(cracked_url)); |
378 | 378 |
379 ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( | 379 ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( |
380 kExternalMountName); | 380 kExternalMountName); |
381 IsolatedContext::GetInstance()->RevokeFileSystem(isolated_fs_id); | 381 IsolatedContext::GetInstance()->RevokeFileSystem(isolated_fs_id); |
382 } | 382 } |
383 | 383 |
384 } // namespace | 384 } // namespace |
385 | 385 |
386 } // namespace content | 386 } // namespace content |
OLD | NEW |