Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: webkit/fileapi/isolated_file_util_unittest.cc

Issue 10920087: Update callers of CreateFileSystemOperation so more detailed error codes can be returned. Where app… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_url_request_job.cc ('k') | webkit/fileapi/local_file_system_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698