| 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 "chrome/browser/media_galleries/fileapi/picasa_data_provider.h" |
| 6 |
| 7 #include <utility> |
| 5 #include <vector> | 8 #include <vector> |
| 6 | 9 |
| 7 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
| 8 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/macros.h" | 13 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
| 14 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
| 15 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 16 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" | 19 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" |
| 17 #include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h" | |
| 18 #include "chrome/common/media_galleries/picasa_test_util.h" | 20 #include "chrome/common/media_galleries/picasa_test_util.h" |
| 19 #include "chrome/common/media_galleries/picasa_types.h" | 21 #include "chrome/common/media_galleries/picasa_types.h" |
| 20 #include "chrome/test/base/in_process_browser_test.h" | 22 #include "chrome/test/base/in_process_browser_test.h" |
| 21 #include "content/public/test/test_browser_thread.h" | 23 #include "content/public/test/test_browser_thread.h" |
| 22 | 24 |
| 23 namespace picasa { | 25 namespace picasa { |
| 24 | 26 |
| 25 namespace { | 27 namespace { |
| 26 | 28 |
| 27 void VerifyTestAlbumTable(PicasaDataProvider* data_provider, | 29 void VerifyTestAlbumTable(PicasaDataProvider* data_provider, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 151 |
| 150 void SetAlbumMapsForTesting(const AlbumMap& album_map, | 152 void SetAlbumMapsForTesting(const AlbumMap& album_map, |
| 151 const AlbumMap& folder_map) { | 153 const AlbumMap& folder_map) { |
| 152 album_map_ = album_map; | 154 album_map_ = album_map; |
| 153 folder_map_ = folder_map; | 155 folder_map_ = folder_map; |
| 154 } | 156 } |
| 155 | 157 |
| 156 private: | 158 private: |
| 157 void OnTempDirWatchStarted( | 159 void OnTempDirWatchStarted( |
| 158 scoped_ptr<base::FilePathWatcher> temp_dir_watcher) override { | 160 scoped_ptr<base::FilePathWatcher> temp_dir_watcher) override { |
| 159 PicasaDataProvider::OnTempDirWatchStarted(temp_dir_watcher.Pass()); | 161 PicasaDataProvider::OnTempDirWatchStarted(std::move(temp_dir_watcher)); |
| 160 | 162 |
| 161 file_watch_request_returned_ = true; | 163 file_watch_request_returned_ = true; |
| 162 for (std::vector<ReadyCallback>::const_iterator it = | 164 for (std::vector<ReadyCallback>::const_iterator it = |
| 163 file_watch_started_callbacks_.begin(); | 165 file_watch_started_callbacks_.begin(); |
| 164 it != file_watch_started_callbacks_.end(); | 166 it != file_watch_started_callbacks_.end(); |
| 165 ++it) { | 167 ++it) { |
| 166 it->Run(temp_dir_watcher_.get() != NULL); | 168 it->Run(temp_dir_watcher_.get() != NULL); |
| 167 } | 169 } |
| 168 file_watch_started_callbacks_.clear(); | 170 file_watch_started_callbacks_.clear(); |
| 169 } | 171 } |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 base::Unretained(this))); | 554 base::Unretained(this))); |
| 553 } | 555 } |
| 554 }; | 556 }; |
| 555 | 557 |
| 556 IN_PROC_BROWSER_TEST_F(PicasaDataProviderInvalidateInflightAlbumsIndexerTest, | 558 IN_PROC_BROWSER_TEST_F(PicasaDataProviderInvalidateInflightAlbumsIndexerTest, |
| 557 InvalidateInflightAlbumsIndexerTest) { | 559 InvalidateInflightAlbumsIndexerTest) { |
| 558 RunTest(); | 560 RunTest(); |
| 559 } | 561 } |
| 560 | 562 |
| 561 } // namespace picasa | 563 } // namespace picasa |
| OLD | NEW |