// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_ #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_ #include #include #include "base/basictypes.h" #include "base/files/scoped_temp_dir.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/test/scoped_path_override.h" #if defined(OS_WIN) #include "base/test/test_reg_util_win.h" #endif namespace extensions { class Extension; } namespace registry_util { class RegistryOverrideManager; } class Profile; #if defined(OS_MACOSX) class MockPreferences; #endif scoped_refptr AddMediaGalleriesApp( const std::string& name, const std::vector& media_galleries_permissions, Profile* profile); class EnsureMediaDirectoriesExists { public: EnsureMediaDirectoriesExists(); ~EnsureMediaDirectoriesExists(); int num_galleries() const { return num_galleries_; } base::FilePath GetFakeAppDataPath() const; // Changes the directories for the media paths (music, pictures, videos) // overrides to new, different directories that are generated. void ChangeMediaPathOverrides(); #if defined(OS_WIN) base::FilePath GetFakeLocalAppDataPath() const; #endif #if defined(OS_WIN) || defined(OS_MACOSX) void SetCustomPicasaAppDataPath(const base::FilePath& path); base::FilePath GetFakePicasaFoldersRootPath() const; #endif #if defined(OS_MACOSX) base::FilePath GetFakeITunesRootPath() const; base::FilePath GetFakeIPhotoRootPath() const; #endif private: void Init(); base::ScopedTempDir fake_dir_; int num_galleries_; int times_overrides_changed_; scoped_ptr app_data_override_; scoped_ptr music_override_; scoped_ptr pictures_override_; scoped_ptr video_override_; #if defined(OS_WIN) scoped_ptr local_app_data_override_; registry_util::RegistryOverrideManager registry_override_; #endif #if defined(OS_MACOSX) scoped_ptr mac_preferences_; #endif DISALLOW_COPY_AND_ASSIGN(EnsureMediaDirectoriesExists); }; extern base::FilePath MakeMediaGalleriesTestingPath(const std::string& dir); #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_