| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/file_system_provider/fileapi/provider_async_fi
le_util.h" | 5 #include "chrome/browser/chromeos/file_system_provider/fileapi/provider_async_fi
le_util.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include <string> | 9 #include <string> |
| 8 #include <vector> | 10 #include <vector> |
| 9 | 11 |
| 10 #include "base/files/file.h" | 12 #include "base/files/file.h" |
| 11 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 12 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
| 15 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 15 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
| 16 #include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system
.h" | 19 #include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system
.h" |
| 17 #include "chrome/browser/chromeos/file_system_provider/service.h" | 20 #include "chrome/browser/chromeos/file_system_provider/service.h" |
| 18 #include "chrome/browser/chromeos/file_system_provider/service_factory.h" | 21 #include "chrome/browser/chromeos/file_system_provider/service_factory.h" |
| 19 #include "chrome/test/base/testing_browser_process.h" | 22 #include "chrome/test/base/testing_browser_process.h" |
| 20 #include "chrome/test/base/testing_profile.h" | 23 #include "chrome/test/base/testing_profile.h" |
| 21 #include "chrome/test/base/testing_profile_manager.h" | 24 #include "chrome/test/base/testing_profile_manager.h" |
| 22 #include "content/public/test/test_browser_thread_bundle.h" | 25 #include "content/public/test/test_browser_thread_bundle.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 } | 75 } |
| 73 | 76 |
| 74 void OnCreateSnapshotFile( | 77 void OnCreateSnapshotFile( |
| 75 base::File::Error error, | 78 base::File::Error error, |
| 76 const base::File::Info& file_info, | 79 const base::File::Info& file_info, |
| 77 const base::FilePath& platform_path, | 80 const base::FilePath& platform_path, |
| 78 const scoped_refptr<storage::ShareableFileReference>& file_ref) { | 81 const scoped_refptr<storage::ShareableFileReference>& file_ref) { |
| 79 result_.reset(new base::File::Error(error)); | 82 result_.reset(new base::File::Error(error)); |
| 80 } | 83 } |
| 81 | 84 |
| 82 void OnCopyFileProgress(int64 size) {} | 85 void OnCopyFileProgress(int64_t size) {} |
| 83 | 86 |
| 84 base::File::Error* result() { return result_.get(); } | 87 base::File::Error* result() { return result_.get(); } |
| 85 | 88 |
| 86 private: | 89 private: |
| 87 scoped_ptr<base::File::Error> result_; | 90 scoped_ptr<base::File::Error> result_; |
| 88 DISALLOW_COPY_AND_ASSIGN(EventLogger); | 91 DISALLOW_COPY_AND_ASSIGN(EventLogger); |
| 89 }; | 92 }; |
| 90 | 93 |
| 91 // Creates a cracked FileSystemURL for tests. | 94 // Creates a cracked FileSystemURL for tests. |
| 92 storage::FileSystemURL CreateFileSystemURL(const std::string& mount_point_name, | 95 storage::FileSystemURL CreateFileSystemURL(const std::string& mount_point_name, |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 file_url_, | 407 file_url_, |
| 405 base::Bind(&EventLogger::OnCreateSnapshotFile, | 408 base::Bind(&EventLogger::OnCreateSnapshotFile, |
| 406 base::Unretained(&logger))); | 409 base::Unretained(&logger))); |
| 407 | 410 |
| 408 ASSERT_TRUE(logger.result()); | 411 ASSERT_TRUE(logger.result()); |
| 409 EXPECT_EQ(base::File::FILE_ERROR_INVALID_OPERATION, *logger.result()); | 412 EXPECT_EQ(base::File::FILE_ERROR_INVALID_OPERATION, *logger.result()); |
| 410 } | 413 } |
| 411 | 414 |
| 412 } // namespace file_system_provider | 415 } // namespace file_system_provider |
| 413 } // namespace chromeos | 416 } // namespace chromeos |
| OLD | NEW |