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

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

Issue 14225022: fileapi: Pass virtual path to copy validator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments 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
« no previous file with comments | « webkit/fileapi/copy_or_move_file_validator.h ('k') | webkit/fileapi/cross_operation_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 }; 171 };
172 172
173 class TestCopyOrMoveFileValidatorFactory 173 class TestCopyOrMoveFileValidatorFactory
174 : public CopyOrMoveFileValidatorFactory { 174 : public CopyOrMoveFileValidatorFactory {
175 public: 175 public:
176 // A factory that creates validators that accept everything or nothing. 176 // A factory that creates validators that accept everything or nothing.
177 TestCopyOrMoveFileValidatorFactory(bool all_valid) : all_valid_(all_valid) {} 177 TestCopyOrMoveFileValidatorFactory(bool all_valid) : all_valid_(all_valid) {}
178 virtual ~TestCopyOrMoveFileValidatorFactory() {} 178 virtual ~TestCopyOrMoveFileValidatorFactory() {}
179 179
180 virtual CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( 180 virtual CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator(
181 const FileSystemURL& /*src_url*/,
181 const base::FilePath& /*platform_path*/) { 182 const base::FilePath& /*platform_path*/) {
182 return new TestCopyOrMoveFileValidator(all_valid_); 183 return new TestCopyOrMoveFileValidator(all_valid_);
183 } 184 }
184 185
185 private: 186 private:
186 class TestCopyOrMoveFileValidator : public CopyOrMoveFileValidator { 187 class TestCopyOrMoveFileValidator : public CopyOrMoveFileValidator {
187 public: 188 public:
188 TestCopyOrMoveFileValidator(bool all_valid) 189 TestCopyOrMoveFileValidator(bool all_valid)
189 : result_(all_valid ? base::PLATFORM_FILE_OK 190 : result_(all_valid ? base::PLATFORM_FILE_OK
190 : base::PLATFORM_FILE_ERROR_SECURITY) { 191 : base::PLATFORM_FILE_ERROR_SECURITY) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 269
269 scoped_ptr<CopyOrMoveFileValidatorFactory> accept_factory( 270 scoped_ptr<CopyOrMoveFileValidatorFactory> accept_factory(
270 new TestCopyOrMoveFileValidatorFactory(true /*accept_all*/)); 271 new TestCopyOrMoveFileValidatorFactory(true /*accept_all*/));
271 helper.SetMediaCopyOrMoveFileValidatorFactory(accept_factory.Pass()); 272 helper.SetMediaCopyOrMoveFileValidatorFactory(accept_factory.Pass());
272 273
273 helper.CopyTest(base::PLATFORM_FILE_ERROR_SECURITY); 274 helper.CopyTest(base::PLATFORM_FILE_ERROR_SECURITY);
274 helper.MoveTest(base::PLATFORM_FILE_ERROR_SECURITY); 275 helper.MoveTest(base::PLATFORM_FILE_ERROR_SECURITY);
275 } 276 }
276 277
277 } // namespace fileapi 278 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/copy_or_move_file_validator.h ('k') | webkit/fileapi/cross_operation_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698