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 IsFileHandler(const std::string& extension_id) { |
177 return true; | 177 return true; |
178 } | 178 } |
179 }; | 179 }; |
180 | 180 |
181 } // namespace | 181 } // namespace |
182 | 182 |
183 class FileSystemPathManagerTest : public testing::Test { | 183 class FileSystemPathManagerTest : public testing::Test { |
184 public: | 184 public: |
185 FileSystemPathManagerTest() | 185 FileSystemPathManagerTest() |
186 : callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 186 : callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 TEST_F(FileSystemPathManagerTest, IsRestrictedName) { | 365 TEST_F(FileSystemPathManagerTest, IsRestrictedName) { |
366 scoped_ptr<FileSystemPathManager> manager(NewPathManager(false, false)); | 366 scoped_ptr<FileSystemPathManager> manager(NewPathManager(false, false)); |
367 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kIsRestrictedNameTestCases); ++i) { | 367 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kIsRestrictedNameTestCases); ++i) { |
368 SCOPED_TRACE(testing::Message() << "IsRestrictedName #" << i << " " | 368 SCOPED_TRACE(testing::Message() << "IsRestrictedName #" << i << " " |
369 << kIsRestrictedNameTestCases[i].name); | 369 << kIsRestrictedNameTestCases[i].name); |
370 FilePath name(kIsRestrictedNameTestCases[i].name); | 370 FilePath name(kIsRestrictedNameTestCases[i].name); |
371 EXPECT_EQ(kIsRestrictedNameTestCases[i].expected_dangerous, | 371 EXPECT_EQ(kIsRestrictedNameTestCases[i].expected_dangerous, |
372 manager->IsRestrictedFileName(kFileSystemTypeTemporary, name)); | 372 manager->IsRestrictedFileName(kFileSystemTypeTemporary, name)); |
373 } | 373 } |
374 } | 374 } |
OLD | NEW |