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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 class FileSystemProviderProviderAsyncFileUtilTest : public testing::Test { | 144 class FileSystemProviderProviderAsyncFileUtilTest : public testing::Test { |
145 protected: | 145 protected: |
146 FileSystemProviderProviderAsyncFileUtilTest() {} | 146 FileSystemProviderProviderAsyncFileUtilTest() {} |
147 virtual ~FileSystemProviderProviderAsyncFileUtilTest() {} | 147 virtual ~FileSystemProviderProviderAsyncFileUtilTest() {} |
148 | 148 |
149 virtual void SetUp() OVERRIDE { | 149 virtual void SetUp() OVERRIDE { |
150 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); | 150 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); |
151 profile_.reset(new TestingProfile); | 151 profile_.reset(new TestingProfile); |
152 async_file_util_.reset(new internal::ProviderAsyncFileUtil); | 152 async_file_util_.reset(new internal::ProviderAsyncFileUtil); |
153 const base::FilePath mount_path = | 153 const base::FilePath mount_path = |
154 util::GetMountPointPath(profile_.get(), kExtensionId, kFileSystemId); | 154 util::GetMountPath(profile_.get(), kExtensionId, kFileSystemId); |
155 file_system_context_ = | 155 file_system_context_ = |
156 content::CreateFileSystemContextForTesting(NULL, data_dir_.path()); | 156 content::CreateFileSystemContextForTesting(NULL, data_dir_.path()); |
157 | 157 |
158 const std::string mount_point_name = mount_path.BaseName().AsUTF8Unsafe(); | 158 const std::string mount_point_name = mount_path.BaseName().AsUTF8Unsafe(); |
159 mount_point_.reset(new ScopedExternalMountPoint( | 159 mount_point_.reset(new ScopedExternalMountPoint( |
160 mount_point_name, mount_path, fileapi::kFileSystemTypeProvided)); | 160 mount_point_name, mount_path, fileapi::kFileSystemTypeProvided)); |
161 ASSERT_TRUE(mount_point_->is_valid()); | 161 ASSERT_TRUE(mount_point_->is_valid()); |
162 | 162 |
163 file_url_ = CreateFileSystemURL( | 163 file_url_ = CreateFileSystemURL( |
164 mount_point_name, base::FilePath::FromUTF8Unsafe("hello/world.txt")); | 164 mount_point_name, base::FilePath::FromUTF8Unsafe("hello/world.txt")); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 CreateOperationContext(), | 414 CreateOperationContext(), |
415 file_url_, | 415 file_url_, |
416 base::Bind(&EventLogger::OnCreateSnapshotFile, logger.GetWeakPtr())); | 416 base::Bind(&EventLogger::OnCreateSnapshotFile, logger.GetWeakPtr())); |
417 | 417 |
418 ASSERT_TRUE(logger.error()); | 418 ASSERT_TRUE(logger.error()); |
419 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, *logger.error()); | 419 EXPECT_EQ(base::File::FILE_ERROR_NOT_FOUND, *logger.error()); |
420 } | 420 } |
421 | 421 |
422 } // namespace file_system_provider | 422 } // namespace file_system_provider |
423 } // namespace chromeos | 423 } // namespace chromeos |
OLD | NEW |