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 <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 297 |
298 for (size_t i = 0; i < arraysize(kUnregisteredCases); ++i) { | 298 for (size_t i = 0; i < arraysize(kUnregisteredCases); ++i) { |
299 SCOPED_TRACE(testing::Message() << "Creating kUnregisteredCases " << i); | 299 SCOPED_TRACE(testing::Message() << "Creating kUnregisteredCases " << i); |
300 const test::TestCaseRecord& test_case = kUnregisteredCases[i]; | 300 const test::TestCaseRecord& test_case = kUnregisteredCases[i]; |
301 FileSystemURL url = GetFileSystemURL(FilePath(test_case.path)); | 301 FileSystemURL url = GetFileSystemURL(FilePath(test_case.path)); |
302 | 302 |
303 // We should not be able to get the valid URL for unregistered files. | 303 // We should not be able to get the valid URL for unregistered files. |
304 ASSERT_FALSE(url.is_valid()); | 304 ASSERT_FALSE(url.is_valid()); |
305 | 305 |
306 // We should not be able to create a new operation for an invalid URL. | 306 // We should not be able to create a new operation for an invalid URL. |
307 ASSERT_EQ(NULL, file_system_context()->CreateFileSystemOperation(url)); | 307 base::PlatformFileError error_code; |
| 308 FileSystemOperation* operation = |
| 309 file_system_context()->CreateFileSystemOperation(url, &error_code); |
| 310 ASSERT_EQ(NULL, operation); |
| 311 ASSERT_EQ(base::PLATFORM_FILE_ERROR_INVALID_URL, error_code); |
308 } | 312 } |
309 } | 313 } |
310 | 314 |
311 TEST_F(IsolatedFileUtilTest, ReadDirectoryTest) { | 315 TEST_F(IsolatedFileUtilTest, ReadDirectoryTest) { |
312 for (size_t i = 0; i < test::kRegularTestCaseSize; ++i) { | 316 for (size_t i = 0; i < test::kRegularTestCaseSize; ++i) { |
313 const test::TestCaseRecord& test_case = test::kRegularTestCases[i]; | 317 const test::TestCaseRecord& test_case = test::kRegularTestCases[i]; |
314 if (!test_case.is_directory) | 318 if (!test_case.is_directory) |
315 continue; | 319 continue; |
316 | 320 |
317 SCOPED_TRACE(testing::Message() << "Testing RegularTestCases " << i | 321 SCOPED_TRACE(testing::Message() << "Testing RegularTestCases " << i |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 EXPECT_EQ(base::PLATFORM_FILE_OK, | 507 EXPECT_EQ(base::PLATFORM_FILE_OK, |
504 file_util()->Truncate(GetOperationContext().get(), url, 999)); | 508 file_util()->Truncate(GetOperationContext().get(), url, 999)); |
505 ASSERT_EQ(base::PLATFORM_FILE_OK, | 509 ASSERT_EQ(base::PLATFORM_FILE_OK, |
506 file_util()->GetFileInfo(GetOperationContext().get(), url, | 510 file_util()->GetFileInfo(GetOperationContext().get(), url, |
507 &info, &platform_path)); | 511 &info, &platform_path)); |
508 EXPECT_EQ(999, info.size); | 512 EXPECT_EQ(999, info.size); |
509 } | 513 } |
510 } | 514 } |
511 | 515 |
512 } // namespace fileapi | 516 } // namespace fileapi |
OLD | NEW |