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_
8 #include "base/basictypes.h"
9 #include "base/files/scoped_temp_dir.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/test/scoped_path_override.h"
15 #include "base/test/test_reg_util_win.h"
18 namespace extensions
{
22 namespace registry_util
{
23 class RegistryOverrideManager
;
28 #if defined(OS_MACOSX)
29 class MockPreferences
;
32 scoped_refptr
<extensions::Extension
> AddMediaGalleriesApp(
33 const std::string
& name
,
34 const std::vector
<std::string
>& media_galleries_permissions
,
37 class EnsureMediaDirectoriesExists
{
39 EnsureMediaDirectoriesExists();
40 ~EnsureMediaDirectoriesExists();
42 int num_galleries() const { return num_galleries_
; }
44 base::FilePath
GetFakeAppDataPath() const;
46 base::FilePath
GetFakeLocalAppDataPath() const;
48 #if defined(OS_WIN) || defined(OS_MACOSX)
49 void SetCustomPicasaAppDataPath(const base::FilePath
& path
);
50 base::FilePath
GetFakePicasaFoldersRootPath() const;
53 #if defined(OS_MACOSX)
54 base::FilePath
GetFakeITunesRootPath() const;
55 base::FilePath
GetFakeIPhotoRootPath() const;
61 base::ScopedTempDir fake_dir_
;
65 scoped_ptr
<base::ScopedPathOverride
> app_data_override_
;
66 scoped_ptr
<base::ScopedPathOverride
> music_override_
;
67 scoped_ptr
<base::ScopedPathOverride
> pictures_override_
;
68 scoped_ptr
<base::ScopedPathOverride
> video_override_
;
70 scoped_ptr
<base::ScopedPathOverride
> local_app_data_override_
;
72 registry_util::RegistryOverrideManager registry_override_
;
74 #if defined(OS_MACOSX)
75 scoped_ptr
<MockPreferences
> mac_preferences_
;
78 DISALLOW_COPY_AND_ASSIGN(EnsureMediaDirectoriesExists
);
81 extern base::FilePath
MakeMediaGalleriesTestingPath(const std::string
& dir
);
83 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_