EME test page application.
[chromium-blink-merge.git] / chrome / browser / media_galleries / media_galleries_test_util.h
blob7b68afca7fc9a4156f07507aa02e5658bee0f356
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"
14 #if defined(OS_WIN)
15 #include "base/test/test_reg_util_win.h"
16 #endif
18 namespace extensions {
19 class Extension;
22 namespace registry_util {
23 class RegistryOverrideManager;
26 class Profile;
28 #if defined(OS_MACOSX)
29 class MockPreferences;
30 #endif
32 scoped_refptr<extensions::Extension> AddMediaGalleriesApp(
33 const std::string& name,
34 const std::vector<std::string>& media_galleries_permissions,
35 Profile* profile);
37 class EnsureMediaDirectoriesExists {
38 public:
39 EnsureMediaDirectoriesExists();
40 ~EnsureMediaDirectoriesExists();
42 int num_galleries() const { return num_galleries_; }
44 base::FilePath GetFakeAppDataPath() const;
45 #if defined(OS_WIN)
46 base::FilePath GetFakeLocalAppDataPath() const;
47 #endif
48 #if defined(OS_WIN) || defined(OS_MACOSX)
49 void SetCustomPicasaAppDataPath(const base::FilePath& path);
50 base::FilePath GetFakePicasaFoldersRootPath() const;
51 #endif
53 #if defined(OS_MACOSX)
54 base::FilePath GetFakeITunesRootPath() const;
55 base::FilePath GetFakeIPhotoRootPath() const;
56 #endif
58 private:
59 void Init();
61 base::ScopedTempDir fake_dir_;
63 int num_galleries_;
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_;
69 #if defined(OS_WIN)
70 scoped_ptr<base::ScopedPathOverride> local_app_data_override_;
72 registry_util::RegistryOverrideManager registry_override_;
73 #endif
74 #if defined(OS_MACOSX)
75 scoped_ptr<MockPreferences> mac_preferences_;
76 #endif
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_