| 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 "storage/browser/fileapi/sandbox_file_system_backend_delegate.h" | 5 #include "storage/browser/fileapi/sandbox_file_system_backend_delegate.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 return storage::FileSystemURL::CreateForTest( | 26 return storage::FileSystemURL::CreateForTest( |
| 27 kOrigin, | 27 kOrigin, |
| 28 storage::kFileSystemTypeTemporary, | 28 storage::kFileSystemTypeTemporary, |
| 29 base::FilePath::FromUTF8Unsafe(path)); | 29 base::FilePath::FromUTF8Unsafe(path)); |
| 30 } | 30 } |
| 31 | 31 |
| 32 } // namespace | 32 } // namespace |
| 33 | 33 |
| 34 class SandboxFileSystemBackendDelegateTest : public testing::Test { | 34 class SandboxFileSystemBackendDelegateTest : public testing::Test { |
| 35 protected: | 35 protected: |
| 36 virtual void SetUp() { | 36 void SetUp() override { |
| 37 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 37 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
| 38 delegate_.reset(new storage::SandboxFileSystemBackendDelegate( | 38 delegate_.reset(new storage::SandboxFileSystemBackendDelegate( |
| 39 NULL /* quota_manager_proxy */, | 39 NULL /* quota_manager_proxy */, |
| 40 base::MessageLoopProxy::current().get(), | 40 base::MessageLoopProxy::current().get(), |
| 41 data_dir_.path(), | 41 data_dir_.path(), |
| 42 NULL /* special_storage_policy */, | 42 NULL /* special_storage_policy */, |
| 43 CreateAllowFileAccessOptions())); | 43 CreateAllowFileAccessOptions())); |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool IsAccessValid(const FileSystemURL& url) const { | 46 bool IsAccessValid(const FileSystemURL& url) const { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 EXPECT_TRUE(IsAccessValid(CreateFileSystemURL(" ."))); | 81 EXPECT_TRUE(IsAccessValid(CreateFileSystemURL(" ."))); |
| 82 EXPECT_TRUE(IsAccessValid(CreateFileSystemURL(". "))); | 82 EXPECT_TRUE(IsAccessValid(CreateFileSystemURL(". "))); |
| 83 EXPECT_TRUE(IsAccessValid(CreateFileSystemURL("b."))); | 83 EXPECT_TRUE(IsAccessValid(CreateFileSystemURL("b."))); |
| 84 EXPECT_TRUE(IsAccessValid(CreateFileSystemURL(".b"))); | 84 EXPECT_TRUE(IsAccessValid(CreateFileSystemURL(".b"))); |
| 85 | 85 |
| 86 // A path that looks like a drive letter. | 86 // A path that looks like a drive letter. |
| 87 EXPECT_TRUE(IsAccessValid(CreateFileSystemURL("c:"))); | 87 EXPECT_TRUE(IsAccessValid(CreateFileSystemURL("c:"))); |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace content | 90 } // namespace content |
| OLD | NEW |