Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1189)

Side by Side Diff: chrome/browser/ui/app_list/arc/arc_app_test.h

Issue 2557513004: Remove explicit singletonness of ArcBridgeService part 3. (Closed)
Patch Set: Address comments. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_ 5 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_
6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_ 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "components/arc/common/app.mojom.h" 13 #include "components/arc/common/app.mojom.h"
14 14
15 namespace arc { 15 namespace arc {
16 namespace mojom { 16 namespace mojom {
17 class AppInfo; 17 class AppInfo;
18 class ArcPackageInfo; 18 class ArcPackageInfo;
19 } 19 }
20 class ArcServiceManager;
20 class ArcSessionManager; 21 class ArcSessionManager;
21 class FakeArcBridgeService;
22 class FakeAppInstance; 22 class FakeAppInstance;
23 } 23 }
24 24
25 namespace chromeos { 25 namespace chromeos {
26 class FakeChromeUserManager; 26 class FakeChromeUserManager;
27 class ScopedUserManagerEnabler; 27 class ScopedUserManagerEnabler;
28 } 28 }
29 29
30 namespace user_manager { 30 namespace user_manager {
31 class User; 31 class User;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 const std::vector<arc::mojom::AppInfo>& fake_default_apps() const { 66 const std::vector<arc::mojom::AppInfo>& fake_default_apps() const {
67 return fake_default_apps_; 67 return fake_default_apps_;
68 } 68 }
69 69
70 const std::vector<arc::mojom::ShortcutInfo>& fake_shortcuts() const { 70 const std::vector<arc::mojom::ShortcutInfo>& fake_shortcuts() const {
71 return fake_shortcuts_; 71 return fake_shortcuts_;
72 } 72 }
73 73
74 chromeos::FakeChromeUserManager* GetUserManager(); 74 chromeos::FakeChromeUserManager* GetUserManager();
75 75
76 arc::FakeArcBridgeService* bridge_service() { return bridge_service_.get(); }
77
78 arc::FakeAppInstance* app_instance() { return app_instance_.get(); } 76 arc::FakeAppInstance* app_instance() { return app_instance_.get(); }
79 77
80 ArcAppListPrefs* arc_app_list_prefs() { return arc_app_list_pref_; } 78 ArcAppListPrefs* arc_app_list_prefs() { return arc_app_list_pref_; }
81 79
82 arc::ArcSessionManager* arc_session_manager() { 80 arc::ArcSessionManager* arc_session_manager() {
83 return arc_session_manager_.get(); 81 return arc_session_manager_.get();
84 } 82 }
83 arc::ArcServiceManager* arc_service_manager() {
84 return arc_service_manager_.get();
85 }
85 86
86 private: 87 private:
87 const user_manager::User* CreateUserAndLogin(); 88 const user_manager::User* CreateUserAndLogin();
88 bool FindPackage(const arc::mojom::ArcPackageInfo& package); 89 bool FindPackage(const arc::mojom::ArcPackageInfo& package);
89 void CreateFakeAppsAndPackages(); 90 void CreateFakeAppsAndPackages();
90 91
91 // Unowned pointer. 92 // Unowned pointer.
92 Profile* profile_ = nullptr; 93 Profile* profile_ = nullptr;
93 94
94 ArcAppListPrefs* arc_app_list_pref_ = nullptr; 95 ArcAppListPrefs* arc_app_list_pref_ = nullptr;
95 96
96 std::unique_ptr<arc::FakeArcBridgeService> bridge_service_; 97 std::unique_ptr<arc::ArcServiceManager> arc_service_manager_;
98 std::unique_ptr<arc::ArcSessionManager> arc_session_manager_;
97 std::unique_ptr<arc::FakeAppInstance> app_instance_; 99 std::unique_ptr<arc::FakeAppInstance> app_instance_;
98 std::unique_ptr<arc::ArcSessionManager> arc_session_manager_; 100
99 std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; 101 std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_;
100 std::vector<arc::mojom::AppInfo> fake_apps_; 102 std::vector<arc::mojom::AppInfo> fake_apps_;
101 std::vector<arc::mojom::AppInfo> fake_default_apps_; 103 std::vector<arc::mojom::AppInfo> fake_default_apps_;
102 std::vector<arc::mojom::ArcPackageInfo> fake_packages_; 104 std::vector<arc::mojom::ArcPackageInfo> fake_packages_;
103 std::vector<arc::mojom::ShortcutInfo> fake_shortcuts_; 105 std::vector<arc::mojom::ShortcutInfo> fake_shortcuts_;
104 106
105 bool dbus_thread_manager_initialized_ = false; 107 bool dbus_thread_manager_initialized_ = false;
106 108
107 DISALLOW_COPY_AND_ASSIGN(ArcAppTest); 109 DISALLOW_COPY_AND_ASSIGN(ArcAppTest);
108 }; 110 };
109 111
110 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_ 112 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc ('k') | chrome/browser/ui/app_list/arc/arc_app_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698