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 "webkit/browser/fileapi/file_system_url.h" | 5 #include "webkit/browser/fileapi/file_system_url.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 #include "webkit/common/fileapi/file_system_types.h" | 10 #include "webkit/common/fileapi/file_system_types.h" |
11 #include "webkit/common/fileapi/file_system_util.h" | 11 #include "webkit/common/fileapi/file_system_util.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 FPL("/a/") | 18 #define DRIVE FPL("/a/") |
19 #endif | 19 #endif |
20 | 20 |
21 namespace fileapi { | 21 using fileapi::FileSystemURL; |
| 22 using fileapi::kFileSystemTypeExternal; |
| 23 using fileapi::kFileSystemTypeIsolated; |
| 24 using fileapi::kFileSystemTypePersistent; |
| 25 using fileapi::kFileSystemTypeTemporary; |
| 26 using fileapi::VirtualPath; |
| 27 |
| 28 namespace content { |
22 | 29 |
23 namespace { | 30 namespace { |
24 | 31 |
25 FileSystemURL CreateFileSystemURL(const std::string& url_string) { | 32 FileSystemURL CreateFileSystemURL(const std::string& url_string) { |
26 FileSystemURL url = FileSystemURL::CreateForTest(GURL(url_string)); | 33 FileSystemURL url = FileSystemURL::CreateForTest(GURL(url_string)); |
27 EXPECT_TRUE(url.type() != kFileSystemTypeExternal && | 34 EXPECT_TRUE(url.type() != kFileSystemTypeExternal && |
28 url.type() != kFileSystemTypeIsolated); | 35 url.type() != kFileSystemTypeIsolated); |
29 return url; | 36 return url; |
30 } | 37 } |
31 | 38 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 GURL("http://bar"), kFileSystemTypePersistent, | 210 GURL("http://bar"), kFileSystemTypePersistent, |
204 base::FilePath::FromUTF8Unsafe("a")); | 211 base::FilePath::FromUTF8Unsafe("a")); |
205 | 212 |
206 EXPECT_TRUE(url_foo_temp_a.IsInSameFileSystem(url_foo_temp_a)); | 213 EXPECT_TRUE(url_foo_temp_a.IsInSameFileSystem(url_foo_temp_a)); |
207 EXPECT_TRUE(url_foo_temp_a.IsInSameFileSystem(url_foo_temp_b)); | 214 EXPECT_TRUE(url_foo_temp_a.IsInSameFileSystem(url_foo_temp_b)); |
208 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_foo_perm_a)); | 215 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_foo_perm_a)); |
209 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_bar_temp_a)); | 216 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_bar_temp_a)); |
210 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_bar_perm_a)); | 217 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_bar_perm_a)); |
211 } | 218 } |
212 | 219 |
213 } // namespace fileapi | 220 } // namespace content |
OLD | NEW |