| 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/file_system_context.h" | 5 #include "webkit/fileapi/file_system_context.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 virtual bool IsFileHandler(const std::string& extension_id) { | 37 virtual bool IsFileHandler(const std::string& extension_id) { |
| 38 return false; | 38 return false; |
| 39 } | 39 } |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 scoped_refptr<FileSystemContext> NewFileSystemContext( | 42 scoped_refptr<FileSystemContext> NewFileSystemContext( |
| 43 bool allow_file_access, | 43 bool allow_file_access, |
| 44 bool unlimited_quota, | 44 bool unlimited_quota, |
| 45 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { | 45 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { |
| 46 return new FileSystemContext(base::MessageLoopProxy::CreateForCurrentThread(), | 46 return new FileSystemContext(base::MessageLoopProxy::current(), |
| 47 base::MessageLoopProxy::CreateForCurrentThread(), | 47 base::MessageLoopProxy::current(), |
| 48 special_storage_policy, | 48 special_storage_policy, |
| 49 NULL /* quota manager */, | 49 NULL /* quota manager */, |
| 50 FilePath(), false /* is_incognito */, | 50 FilePath(), false /* is_incognito */, |
| 51 allow_file_access, unlimited_quota, NULL); | 51 allow_file_access, unlimited_quota, NULL); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // anonymous namespace | 54 } // anonymous namespace |
| 55 | 55 |
| 56 TEST(FileSystemContextTest, IsStorageUnlimited) { | 56 TEST(FileSystemContextTest, IsStorageUnlimited) { |
| 57 // Regular cases. | 57 // Regular cases. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 86 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestOrigins); ++i) { | 86 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestOrigins); ++i) { |
| 87 SCOPED_TRACE(testing::Message() << "IsStorageUnlimited /w policy #" | 87 SCOPED_TRACE(testing::Message() << "IsStorageUnlimited /w policy #" |
| 88 << i << " " << kTestOrigins[i]); | 88 << i << " " << kTestOrigins[i]); |
| 89 GURL origin(kTestOrigins[i]); | 89 GURL origin(kTestOrigins[i]); |
| 90 EXPECT_EQ(policy->IsStorageUnlimited(origin), | 90 EXPECT_EQ(policy->IsStorageUnlimited(origin), |
| 91 context->IsStorageUnlimited(origin)); | 91 context->IsStorageUnlimited(origin)); |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace fileapi | 95 } // namespace fileapi |
| OLD | NEW |