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 "chrome/browser/chromeos/file_system_provider/mount_path_util.h" | 5 #include "chrome/browser/chromeos/file_system_provider/mount_path_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 ProvidedFileSystemInterface* file_system = parser.file_system(); | 159 ProvidedFileSystemInterface* file_system = parser.file_system(); |
160 ASSERT_TRUE(file_system); | 160 ASSERT_TRUE(file_system); |
161 EXPECT_EQ(kFileSystemId, file_system->GetFileSystemInfo().file_system_id()); | 161 EXPECT_EQ(kFileSystemId, file_system->GetFileSystemInfo().file_system_id()); |
162 EXPECT_EQ(kFilePath.AsUTF8Unsafe(), parser.file_path().AsUTF8Unsafe()); | 162 EXPECT_EQ(kFilePath.AsUTF8Unsafe(), parser.file_path().AsUTF8Unsafe()); |
163 } | 163 } |
164 | 164 |
165 TEST_F(FileSystemProviderMountPathUtilTest, Parser_WrongUrl) { | 165 TEST_F(FileSystemProviderMountPathUtilTest, Parser_WrongUrl) { |
166 const ProvidedFileSystemInfo file_system_info( | 166 const ProvidedFileSystemInfo file_system_info( |
167 kExtensionId, MountOptions(kFileSystemId, kDisplayName), | 167 kExtensionId, MountOptions(kFileSystemId, kDisplayName), |
168 GetMountPath(profile_, kExtensionId, kFileSystemId), | 168 GetMountPath(profile_, kExtensionId, kFileSystemId), |
169 false /* configurable */, extensions::SOURCE_FILE); | 169 false /* configurable */, true /* watchable */, extensions::SOURCE_FILE); |
170 | 170 |
171 const base::FilePath kFilePath = base::FilePath(FILE_PATH_LITERAL("/hello")); | 171 const base::FilePath kFilePath = base::FilePath(FILE_PATH_LITERAL("/hello")); |
172 const storage::FileSystemURL url = | 172 const storage::FileSystemURL url = |
173 CreateFileSystemURL(profile_, file_system_info, kFilePath); | 173 CreateFileSystemURL(profile_, file_system_info, kFilePath); |
174 // It is impossible to create a cracked URL for a mount point which doesn't | 174 // It is impossible to create a cracked URL for a mount point which doesn't |
175 // exist, therefore is will always be invalid, and empty. | 175 // exist, therefore is will always be invalid, and empty. |
176 EXPECT_FALSE(url.is_valid()); | 176 EXPECT_FALSE(url.is_valid()); |
177 | 177 |
178 FileSystemURLParser parser(url); | 178 FileSystemURLParser parser(url); |
179 EXPECT_FALSE(parser.Parse()); | 179 EXPECT_FALSE(parser.Parse()); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 const base::FilePath kFilePath = | 292 const base::FilePath kFilePath = |
293 base::FilePath(FILE_PATH_LITERAL("provided/hello/world")); | 293 base::FilePath(FILE_PATH_LITERAL("provided/hello/world")); |
294 LocalPathParser parser(profile_, kFilePath); | 294 LocalPathParser parser(profile_, kFilePath); |
295 EXPECT_FALSE(parser.Parse()); | 295 EXPECT_FALSE(parser.Parse()); |
296 } | 296 } |
297 } | 297 } |
298 | 298 |
299 } // namespace util | 299 } // namespace util |
300 } // namespace file_system_provider | 300 } // namespace file_system_provider |
301 } // namespace chromeos | 301 } // namespace chromeos |
OLD | NEW |