| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "webkit/browser/fileapi/file_system_url.h" | 10 #include "webkit/browser/fileapi/file_system_url.h" |
| 11 #include "webkit/browser/fileapi/isolated_context.h" | 11 #include "webkit/browser/fileapi/isolated_context.h" |
| 12 | 12 |
| 13 #define FPL(x) FILE_PATH_LITERAL(x) | 13 #define FPL(x) FILE_PATH_LITERAL(x) |
| 14 | 14 |
| 15 #if defined(FILE_PATH_USES_DRIVE_LETTERS) | 15 #if defined(FILE_PATH_USES_DRIVE_LETTERS) |
| 16 #define DRIVE FPL("C:") | 16 #define DRIVE FPL("C:") |
| 17 #else | 17 #else |
| 18 #define DRIVE | 18 #define DRIVE |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 namespace fileapi { | 21 using fileapi::FileSystemMountOption; |
| 22 using fileapi::FileSystemType; |
| 23 using fileapi::FileSystemURL; |
| 24 using fileapi::IsolatedContext; |
| 25 using fileapi::kFileSystemTypeDragged; |
| 26 using fileapi::kFileSystemTypeIsolated; |
| 27 using fileapi::kFileSystemTypeNativeLocal; |
| 28 |
| 29 namespace content { |
| 22 | 30 |
| 23 typedef IsolatedContext::MountPointInfo FileInfo; | 31 typedef IsolatedContext::MountPointInfo FileInfo; |
| 24 | 32 |
| 25 namespace { | 33 namespace { |
| 26 | 34 |
| 27 const base::FilePath kTestPaths[] = { | 35 const base::FilePath kTestPaths[] = { |
| 28 base::FilePath(DRIVE FPL("/a/b.txt")), | 36 base::FilePath(DRIVE FPL("/a/b.txt")), |
| 29 base::FilePath(DRIVE FPL("/c/d/e")), | 37 base::FilePath(DRIVE FPL("/c/d/e")), |
| 30 base::FilePath(DRIVE FPL("/h/")), | 38 base::FilePath(DRIVE FPL("/h/")), |
| 31 base::FilePath(DRIVE FPL("/")), | 39 base::FilePath(DRIVE FPL("/")), |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 343 |
| 336 std::string cracked_id; | 344 std::string cracked_id; |
| 337 base::FilePath cracked_path; | 345 base::FilePath cracked_path; |
| 338 FileSystemMountOption cracked_option; | 346 FileSystemMountOption cracked_option; |
| 339 ASSERT_TRUE(isolated_context()->CrackVirtualPath( | 347 ASSERT_TRUE(isolated_context()->CrackVirtualPath( |
| 340 whole_virtual_path, &cracked_id, NULL, &cracked_path, &cracked_option)); | 348 whole_virtual_path, &cracked_id, NULL, &cracked_path, &cracked_option)); |
| 341 ASSERT_EQ(database_fsid, cracked_id); | 349 ASSERT_EQ(database_fsid, cracked_id); |
| 342 ASSERT_EQ(test_virtual_path, cracked_path); | 350 ASSERT_EQ(test_virtual_path, cracked_path); |
| 343 } | 351 } |
| 344 | 352 |
| 345 } // namespace fileapi | 353 } // namespace content |
| OLD | NEW |