OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/external_mount_points.h" | 5 #include "webkit/browser/fileapi/external_mount_points.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "webkit/browser/fileapi/file_system_url.h" | 11 #include "webkit/browser/fileapi/file_system_url.h" |
12 | 12 |
13 #define FPL FILE_PATH_LITERAL | 13 #define FPL FILE_PATH_LITERAL |
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 using fileapi::FileSystemURL; | 21 using fileapi::FileSystemURL; |
22 | 22 |
23 namespace { | 23 namespace content { |
24 | 24 |
25 TEST(ExternalMountPointsTest, AddMountPoint) { | 25 TEST(ExternalMountPointsTest, AddMountPoint) { |
26 scoped_refptr<fileapi::ExternalMountPoints> mount_points( | 26 scoped_refptr<fileapi::ExternalMountPoints> mount_points( |
27 fileapi::ExternalMountPoints::CreateRefCounted()); | 27 fileapi::ExternalMountPoints::CreateRefCounted()); |
28 | 28 |
29 struct TestCase { | 29 struct TestCase { |
30 // The mount point's name. | 30 // The mount point's name. |
31 const char* const name; | 31 const char* const name; |
32 // The mount point's path. | 32 // The mount point's path. |
33 const base::FilePath::CharType* const path; | 33 const base::FilePath::CharType* const path; |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 fileapi::FileSystemMountOption option; | 496 fileapi::FileSystemMountOption option; |
497 base::FilePath path; | 497 base::FilePath path; |
498 EXPECT_TRUE(mount_points->CrackVirtualPath( | 498 EXPECT_TRUE(mount_points->CrackVirtualPath( |
499 base::FilePath(FPL("nosync/file")), &name, &type, &path, &option)); | 499 base::FilePath(FPL("nosync/file")), &name, &type, &path, &option)); |
500 EXPECT_EQ(fileapi::COPY_SYNC_OPTION_NO_SYNC, option.copy_sync_option()); | 500 EXPECT_EQ(fileapi::COPY_SYNC_OPTION_NO_SYNC, option.copy_sync_option()); |
501 EXPECT_TRUE(mount_points->CrackVirtualPath( | 501 EXPECT_TRUE(mount_points->CrackVirtualPath( |
502 base::FilePath(FPL("sync/file")), &name, &type, &path, &option)); | 502 base::FilePath(FPL("sync/file")), &name, &type, &path, &option)); |
503 EXPECT_EQ(fileapi::COPY_SYNC_OPTION_SYNC, option.copy_sync_option()); | 503 EXPECT_EQ(fileapi::COPY_SYNC_OPTION_SYNC, option.copy_sync_option()); |
504 } | 504 } |
505 | 505 |
506 } // namespace | 506 } // namespace content |
507 | 507 |
OLD | NEW |