1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_
11 #include "base/basictypes.h"
12 #include "base/files/scoped_temp_dir.h"
13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "base/test/scoped_path_override.h"
18 #include "base/test/test_reg_util_win.h"
21 namespace extensions {
25 namespace registry_util {
26 class RegistryOverrideManager;
31 #if defined(OS_MACOSX)
32 class MockPreferences;
35 scoped_refptr<extensions::Extension> AddMediaGalleriesApp(
36 const std::string& name,
37 const std::vector<std::string>& media_galleries_permissions,
40 class EnsureMediaDirectoriesExists {
42 EnsureMediaDirectoriesExists();
43 ~EnsureMediaDirectoriesExists();
45 int num_galleries() const { return num_galleries_; }
47 base::FilePath GetFakeAppDataPath() const;
49 // Changes the directories for the media paths (music, pictures, videos)
50 // overrides to new, different directories that are generated.
51 void ChangeMediaPathOverrides();
53 base::FilePath GetFakeLocalAppDataPath() const;
55 #if defined(OS_WIN) || defined(OS_MACOSX)
56 void SetCustomPicasaAppDataPath(const base::FilePath& path);
57 base::FilePath GetFakePicasaFoldersRootPath() const;
60 #if defined(OS_MACOSX)
61 base::FilePath GetFakeITunesRootPath() const;
62 base::FilePath GetFakeIPhotoRootPath() const;
68 base::ScopedTempDir fake_dir_;
72 int times_overrides_changed_;
74 scoped_ptr<base::ScopedPathOverride> app_data_override_;
75 scoped_ptr<base::ScopedPathOverride> music_override_;
76 scoped_ptr<base::ScopedPathOverride> pictures_override_;
77 scoped_ptr<base::ScopedPathOverride> video_override_;
79 scoped_ptr<base::ScopedPathOverride> local_app_data_override_;
81 registry_util::RegistryOverrideManager registry_override_;
83 #if defined(OS_MACOSX)
84 scoped_ptr<MockPreferences> mac_preferences_;
87 DISALLOW_COPY_AND_ASSIGN(EnsureMediaDirectoriesExists);
90 extern base::FilePath MakeMediaGalleriesTestingPath(const std::string& dir);
92 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_