| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "base/test/scoped_path_override.h" | 12 #include "base/test/scoped_path_override.h" |
| 13 #include "chrome/browser/extensions/test_extension_system.h" | 13 #include "chrome/browser/extensions/test_extension_system.h" |
| 14 #include "chrome/browser/media_galleries/gallery_watch_manager.h" | 14 #include "chrome/browser/media_galleries/gallery_watch_manager.h" |
| 15 #include "chrome/browser/media_galleries/gallery_watch_manager_observer.h" | 15 #include "chrome/browser/media_galleries/gallery_watch_manager_observer.h" |
| 16 #include "chrome/browser/media_galleries/media_galleries_preferences.h" | 16 #include "chrome/browser/media_galleries/media_galleries_preferences.h" |
| 17 #include "chrome/browser/media_galleries/media_galleries_preferences_factory.h" | 17 #include "chrome/browser/media_galleries/media_galleries_preferences_factory.h" |
| 18 #include "chrome/browser/media_galleries/media_galleries_test_util.h" | 18 #include "chrome/browser/media_galleries/media_galleries_test_util.h" |
| 19 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
| 20 #include "components/storage_monitor/test_storage_monitor.h" | 20 #include "components/storage_monitor/test_storage_monitor.h" |
| 21 #include "content/public/test/test_browser_thread_bundle.h" | 21 #include "content/public/test/test_browser_thread_bundle.h" |
| 22 #include "extensions/browser/extension_system.h" | 22 #include "extensions/browser/extension_system.h" |
| 23 #include "extensions/common/extension.h" | 23 #include "extensions/common/extension.h" |
| 24 #include "extensions/common/permissions/media_galleries_permission.h" | 24 #include "extensions/common/permissions/media_galleries_permission.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 26 |
| 27 #if defined(OS_CHROMEOS) | 27 #if defined(OS_CHROMEOS) |
| 28 #include "chrome/browser/chromeos/login/users/user_manager.h" | 28 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h" |
| 29 #include "chrome/browser/chromeos/settings/cros_settings.h" | 29 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 30 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 30 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 namespace component_updater { | 33 namespace component_updater { |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 void ConfirmWatch(base::RunLoop* loop, const std::string& error) { | 37 void ConfirmWatch(base::RunLoop* loop, const std::string& error) { |
| 38 EXPECT_TRUE(error.empty()); | 38 EXPECT_TRUE(error.empty()); |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 AddAndConfirmWatch(id); | 322 AddAndConfirmWatch(id); |
| 323 | 323 |
| 324 base::RunLoop success_loop; | 324 base::RunLoop success_loop; |
| 325 ExpectGalleryChanged(&success_loop); | 325 ExpectGalleryChanged(&success_loop); |
| 326 ASSERT_EQ( | 326 ASSERT_EQ( |
| 327 4, base::WriteFile(temp_dir.path().AppendASCII("fake file"), "blah", 4)); | 327 4, base::WriteFile(temp_dir.path().AppendASCII("fake file"), "blah", 4)); |
| 328 success_loop.Run(); | 328 success_loop.Run(); |
| 329 } | 329 } |
| 330 | 330 |
| 331 } // namespace component_updater | 331 } // namespace component_updater |
| OLD | NEW |