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

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

Issue 7312023: Refactoring: Change all -FileUtils non-Singleton and to own underlying FileUtils. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Reflected the comments. Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/file_system_operation.h" 5 #include "webkit/fileapi/file_system_operation.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 } // namespace (anonymous) 150 } // namespace (anonymous)
151 151
152 // Test class for FileSystemOperation. Note that this just tests low-level 152 // Test class for FileSystemOperation. Note that this just tests low-level
153 // operations but doesn't test OpenFileSystem. 153 // operations but doesn't test OpenFileSystem.
154 class FileSystemOperationTest : public testing::Test { 154 class FileSystemOperationTest : public testing::Test {
155 public: 155 public:
156 FileSystemOperationTest() 156 FileSystemOperationTest()
157 : status_(kFileOperationStatusNotSet), 157 : status_(kFileOperationStatusNotSet),
158 local_file_util_( 158 local_file_util_(
159 new LocalFileSystemFileUtil(QuotaFileUtil::GetInstance())) { 159 new LocalFileSystemFileUtil(QuotaFileUtil::CreateDefault())) {
160 EXPECT_TRUE(base_.CreateUniqueTempDir()); 160 EXPECT_TRUE(base_.CreateUniqueTempDir());
161 } 161 }
162 162
163 FileSystemOperation* operation(); 163 FileSystemOperation* operation();
164 164
165 void set_status(int status) { status_ = status; } 165 void set_status(int status) { status_ = status; }
166 int status() const { return status_; } 166 int status() const { return status_; }
167 void set_info(const base::PlatformFileInfo& info) { info_ = info; } 167 void set_info(const base::PlatformFileInfo& info) { info_ = info; }
168 const base::PlatformFileInfo& info() const { return info_; } 168 const base::PlatformFileInfo& info() const { return info_; }
169 void set_path(const FilePath& path) { path_ = path; } 169 void set_path(const FilePath& path) { path_ = path; }
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 950
951 operation()->Truncate(URLForPath(file_path), 11); 951 operation()->Truncate(URLForPath(file_path), 11);
952 MessageLoop::current()->RunAllPending(); 952 MessageLoop::current()->RunAllPending();
953 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); 953 EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status());
954 954
955 EXPECT_TRUE(file_util::GetFileInfo(PlatformPath(file_path), &info)); 955 EXPECT_TRUE(file_util::GetFileInfo(PlatformPath(file_path), &info));
956 EXPECT_EQ(10, info.size); 956 EXPECT_EQ(10, info.size);
957 } 957 }
958 958
959 } // namespace fileapi 959 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_file_util_unittest.cc ('k') | webkit/fileapi/file_system_operation_write_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698