| 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/sandbox_file_system_backend.h" | 5 #include "webkit/browser/fileapi/sandbox_file_system_backend.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 const char* origin_url; | 59 const char* origin_url; |
| 60 const char* expected_path; | 60 const char* expected_path; |
| 61 const char* virtual_path; | 61 const char* virtual_path; |
| 62 } kRootPathFileURITestCases[] = { | 62 } kRootPathFileURITestCases[] = { |
| 63 { fileapi::kFileSystemTypeTemporary, "file:///", | 63 { fileapi::kFileSystemTypeTemporary, "file:///", |
| 64 "000" PS "t", NULL }, | 64 "000" PS "t", NULL }, |
| 65 { fileapi::kFileSystemTypePersistent, "file:///", | 65 { fileapi::kFileSystemTypePersistent, "file:///", |
| 66 "000" PS "p", NULL }, | 66 "000" PS "p", NULL }, |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 FileSystemURL CreateFileSystemURL(const char* path) { | |
| 70 const GURL kOrigin("http://foo/"); | |
| 71 return FileSystemURL::CreateForTest( | |
| 72 kOrigin, kFileSystemTypeTemporary, base::FilePath::FromUTF8Unsafe(path)); | |
| 73 } | |
| 74 | |
| 75 void DidOpenFileSystem(base::PlatformFileError* error_out, | 69 void DidOpenFileSystem(base::PlatformFileError* error_out, |
| 76 const GURL& origin_url, | 70 const GURL& origin_url, |
| 77 const std::string& name, | 71 const std::string& name, |
| 78 base::PlatformFileError error) { | 72 base::PlatformFileError error) { |
| 79 *error_out = error; | 73 *error_out = error; |
| 80 } | 74 } |
| 81 | 75 |
| 82 } // namespace | 76 } // namespace |
| 83 | 77 |
| 84 class SandboxFileSystemBackendTest : public testing::Test { | 78 class SandboxFileSystemBackendTest : public testing::Test { |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, | 310 OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, |
| 317 &root_path)); | 311 &root_path)); |
| 318 base::FilePath expected = file_system_path().AppendASCII( | 312 base::FilePath expected = file_system_path().AppendASCII( |
| 319 kRootPathFileURITestCases[i].expected_path); | 313 kRootPathFileURITestCases[i].expected_path); |
| 320 EXPECT_EQ(expected.value(), root_path.value()); | 314 EXPECT_EQ(expected.value(), root_path.value()); |
| 321 EXPECT_TRUE(base::DirectoryExists(root_path)); | 315 EXPECT_TRUE(base::DirectoryExists(root_path)); |
| 322 } | 316 } |
| 323 } | 317 } |
| 324 | 318 |
| 325 } // namespace fileapi | 319 } // namespace fileapi |
| OLD | NEW |