| OLD | NEW |
| 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 <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 } // namespace | 184 } // namespace |
| 185 | 185 |
| 186 class TestPicasaFileUtil : public PicasaFileUtil { | 186 class TestPicasaFileUtil : public PicasaFileUtil { |
| 187 public: | 187 public: |
| 188 TestPicasaFileUtil(MediaPathFilter* media_path_filter, | 188 TestPicasaFileUtil(MediaPathFilter* media_path_filter, |
| 189 PicasaDataProvider* data_provider) | 189 PicasaDataProvider* data_provider) |
| 190 : PicasaFileUtil(media_path_filter), | 190 : PicasaFileUtil(media_path_filter), |
| 191 data_provider_(data_provider) { | 191 data_provider_(data_provider) { |
| 192 } | 192 } |
| 193 virtual ~TestPicasaFileUtil() {} | 193 ~TestPicasaFileUtil() override {} |
| 194 |
| 194 private: | 195 private: |
| 195 virtual PicasaDataProvider* GetDataProvider() override { | 196 PicasaDataProvider* GetDataProvider() override { return data_provider_; } |
| 196 return data_provider_; | |
| 197 } | |
| 198 | 197 |
| 199 PicasaDataProvider* data_provider_; | 198 PicasaDataProvider* data_provider_; |
| 200 }; | 199 }; |
| 201 | 200 |
| 202 class TestMediaFileSystemBackend : public MediaFileSystemBackend { | 201 class TestMediaFileSystemBackend : public MediaFileSystemBackend { |
| 203 public: | 202 public: |
| 204 TestMediaFileSystemBackend(const base::FilePath& profile_path, | 203 TestMediaFileSystemBackend(const base::FilePath& profile_path, |
| 205 PicasaFileUtil* picasa_file_util) | 204 PicasaFileUtil* picasa_file_util) |
| 206 : MediaFileSystemBackend(profile_path, | 205 : MediaFileSystemBackend(profile_path, |
| 207 MediaFileSystemBackend::MediaTaskRunner().get()), | 206 MediaFileSystemBackend::MediaTaskRunner().get()), |
| 208 test_file_util_(picasa_file_util) {} | 207 test_file_util_(picasa_file_util) {} |
| 209 | 208 |
| 210 virtual storage::AsyncFileUtil* GetAsyncFileUtil( | 209 storage::AsyncFileUtil* GetAsyncFileUtil( |
| 211 storage::FileSystemType type) override { | 210 storage::FileSystemType type) override { |
| 212 if (type != storage::kFileSystemTypePicasa) | 211 if (type != storage::kFileSystemTypePicasa) |
| 213 return NULL; | 212 return NULL; |
| 214 | 213 |
| 215 return test_file_util_.get(); | 214 return test_file_util_.get(); |
| 216 } | 215 } |
| 217 | 216 |
| 218 private: | 217 private: |
| 219 scoped_ptr<storage::AsyncFileUtil> test_file_util_; | 218 scoped_ptr<storage::AsyncFileUtil> test_file_util_; |
| 220 }; | 219 }; |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 operation_runner()->CreateSnapshotFile( | 591 operation_runner()->CreateSnapshotFile( |
| 593 CreateURL(std::string(kPicasaDirAlbums) + | 592 CreateURL(std::string(kPicasaDirAlbums) + |
| 594 "/albumname 2013-04-16/mapped_name.jpg"), | 593 "/albumname 2013-04-16/mapped_name.jpg"), |
| 595 snapshot_callback); | 594 snapshot_callback); |
| 596 loop.Run(); | 595 loop.Run(); |
| 597 EXPECT_EQ(base::File::FILE_OK, error); | 596 EXPECT_EQ(base::File::FILE_OK, error); |
| 598 EXPECT_EQ(image_path, platform_path_result); | 597 EXPECT_EQ(image_path, platform_path_result); |
| 599 } | 598 } |
| 600 | 599 |
| 601 } // namespace picasa | 600 } // namespace picasa |
| OLD | NEW |