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

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

Issue 13196006: Move path functions from file_util to FilePath object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 "webkit/fileapi/local_file_system_operation.h" 5 #include "webkit/fileapi/local_file_system_operation.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 MessageLoop::current()->RunUntilIdle(); 539 MessageLoop::current()->RunUntilIdle();
540 EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); 540 EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status());
541 EXPECT_TRUE(change_observer()->HasNoChange()); 541 EXPECT_TRUE(change_observer()->HasNoChange());
542 } 542 }
543 543
544 TEST_F(LocalFileSystemOperationTest, TestCopyFailureDestParentDoesntExist) { 544 TEST_F(LocalFileSystemOperationTest, TestCopyFailureDestParentDoesntExist) {
545 // Dest. parent path does not exist. 545 // Dest. parent path does not exist.
546 base::FilePath src_dir_path(CreateUniqueDir()); 546 base::FilePath src_dir_path(CreateUniqueDir());
547 base::FilePath nonexisting_path = base::FilePath( 547 base::FilePath nonexisting_path = base::FilePath(
548 FILE_PATH_LITERAL("DontExistDir")); 548 FILE_PATH_LITERAL("DontExistDir"));
549 file_util::EnsureEndsWithSeparator(&nonexisting_path);
550 base::FilePath nonexisting_file_path(nonexisting_path.Append( 549 base::FilePath nonexisting_file_path(nonexisting_path.Append(
551 FILE_PATH_LITERAL("DontExistFile"))); 550 FILE_PATH_LITERAL("DontExistFile")));
552 551
553 NewOperation()->Copy( 552 NewOperation()->Copy(
554 URLForPath(src_dir_path), 553 URLForPath(src_dir_path),
555 URLForPath(nonexisting_file_path), 554 URLForPath(nonexisting_file_path),
556 RecordStatusCallback()); 555 RecordStatusCallback());
557 MessageLoop::current()->RunUntilIdle(); 556 MessageLoop::current()->RunUntilIdle();
558 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); 557 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status());
559 EXPECT_TRUE(change_observer()->HasNoChange()); 558 EXPECT_TRUE(change_observer()->HasNoChange());
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 EXPECT_FALSE(info().is_directory); 1212 EXPECT_FALSE(info().is_directory);
1214 EXPECT_EQ(PlatformPath(file_path), path()); 1213 EXPECT_EQ(PlatformPath(file_path), path());
1215 EXPECT_TRUE(change_observer()->HasNoChange()); 1214 EXPECT_TRUE(change_observer()->HasNoChange());
1216 1215
1217 // The FileSystemOpration implementation does not create a 1216 // The FileSystemOpration implementation does not create a
1218 // shareable file reference. 1217 // shareable file reference.
1219 EXPECT_EQ(NULL, shareable_file_ref()); 1218 EXPECT_EQ(NULL, shareable_file_ref());
1220 } 1219 }
1221 1220
1222 } // namespace fileapi 1221 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698