OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "storage/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 "storage/common/fileapi/file_system_types.h" |
11 #include "webkit/common/fileapi/file_system_util.h" | 11 #include "storage/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 using fileapi::FileSystemURL; | 21 using storage::FileSystemURL; |
22 using fileapi::kFileSystemTypeExternal; | 22 using storage::kFileSystemTypeExternal; |
23 using fileapi::kFileSystemTypeIsolated; | 23 using storage::kFileSystemTypeIsolated; |
24 using fileapi::kFileSystemTypePersistent; | 24 using storage::kFileSystemTypePersistent; |
25 using fileapi::kFileSystemTypeTemporary; | 25 using storage::kFileSystemTypeTemporary; |
26 using fileapi::VirtualPath; | 26 using storage::VirtualPath; |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 FileSystemURL CreateFileSystemURL(const std::string& url_string) { | 32 FileSystemURL CreateFileSystemURL(const std::string& url_string) { |
33 FileSystemURL url = FileSystemURL::CreateForTest(GURL(url_string)); | 33 FileSystemURL url = FileSystemURL::CreateForTest(GURL(url_string)); |
34 EXPECT_TRUE(url.type() != kFileSystemTypeExternal && | 34 EXPECT_TRUE(url.type() != kFileSystemTypeExternal && |
35 url.type() != kFileSystemTypeIsolated); | 35 url.type() != kFileSystemTypeIsolated); |
36 return url; | 36 return url; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 base::FilePath::FromUTF8Unsafe("a")); | 212 base::FilePath::FromUTF8Unsafe("a")); |
213 | 213 |
214 EXPECT_TRUE(url_foo_temp_a.IsInSameFileSystem(url_foo_temp_a)); | 214 EXPECT_TRUE(url_foo_temp_a.IsInSameFileSystem(url_foo_temp_a)); |
215 EXPECT_TRUE(url_foo_temp_a.IsInSameFileSystem(url_foo_temp_b)); | 215 EXPECT_TRUE(url_foo_temp_a.IsInSameFileSystem(url_foo_temp_b)); |
216 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_foo_perm_a)); | 216 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_foo_perm_a)); |
217 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_bar_temp_a)); | 217 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_bar_temp_a)); |
218 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_bar_perm_a)); | 218 EXPECT_FALSE(url_foo_temp_a.IsInSameFileSystem(url_bar_perm_a)); |
219 } | 219 } |
220 | 220 |
221 } // namespace content | 221 } // namespace content |
OLD | NEW |