| 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_path_manager.h" | 5 #include "webkit/fileapi/file_system_path_manager.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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 class TestSpecialStoragePolicy : public quota::SpecialStoragePolicy { | 166 class TestSpecialStoragePolicy : public quota::SpecialStoragePolicy { |
| 167 public: | 167 public: |
| 168 virtual bool IsStorageProtected(const GURL& origin) { | 168 virtual bool IsStorageProtected(const GURL& origin) { |
| 169 return false; | 169 return false; |
| 170 } | 170 } |
| 171 | 171 |
| 172 virtual bool IsStorageUnlimited(const GURL& origin) { | 172 virtual bool IsStorageUnlimited(const GURL& origin) { |
| 173 return true; | 173 return true; |
| 174 } | 174 } |
| 175 | 175 |
| 176 virtual bool IsLocalFileSystemAccessAllowed(const GURL& origin) { | 176 virtual bool IsLocalFileSystemAccessAllowed(const GURL& origin, |
| 177 const FilePath& virtual_path) { |
| 177 return true; | 178 return true; |
| 178 } | 179 } |
| 180 |
| 181 virtual void GrantLocalFileSystemAccess(const GURL& origin, |
| 182 const FilePath& virtual_path) { |
| 183 } |
| 179 }; | 184 }; |
| 180 | 185 |
| 181 } // namespace | 186 } // namespace |
| 182 | 187 |
| 183 class FileSystemPathManagerTest : public testing::Test { | 188 class FileSystemPathManagerTest : public testing::Test { |
| 184 public: | 189 public: |
| 185 FileSystemPathManagerTest() | 190 FileSystemPathManagerTest() |
| 186 : callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 191 : callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
| 187 } | 192 } |
| 188 | 193 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 TEST_F(FileSystemPathManagerTest, IsRestrictedName) { | 458 TEST_F(FileSystemPathManagerTest, IsRestrictedName) { |
| 454 scoped_ptr<FileSystemPathManager> manager(NewPathManager(false, false)); | 459 scoped_ptr<FileSystemPathManager> manager(NewPathManager(false, false)); |
| 455 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kIsRestrictedNameTestCases); ++i) { | 460 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kIsRestrictedNameTestCases); ++i) { |
| 456 SCOPED_TRACE(testing::Message() << "IsRestrictedName #" << i << " " | 461 SCOPED_TRACE(testing::Message() << "IsRestrictedName #" << i << " " |
| 457 << kIsRestrictedNameTestCases[i].name); | 462 << kIsRestrictedNameTestCases[i].name); |
| 458 FilePath name(kIsRestrictedNameTestCases[i].name); | 463 FilePath name(kIsRestrictedNameTestCases[i].name); |
| 459 EXPECT_EQ(kIsRestrictedNameTestCases[i].expected_dangerous, | 464 EXPECT_EQ(kIsRestrictedNameTestCases[i].expected_dangerous, |
| 460 manager->IsRestrictedFileName(kFileSystemTypeTemporary, name)); | 465 manager->IsRestrictedFileName(kFileSystemTypeTemporary, name)); |
| 461 } | 466 } |
| 462 } | 467 } |
| OLD | NEW |