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

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

Issue 2751913004: arc: Fix race conditon when Play Store is started too early. (Closed)
Patch Set: nits Created 3 years, 9 months 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>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 static std::string GetAppId(const arc::mojom::ShortcutInfo& shortcut); 52 static std::string GetAppId(const arc::mojom::ShortcutInfo& shortcut);
53 53
54 const std::vector<arc::mojom::ArcPackageInfo>& fake_packages() const { 54 const std::vector<arc::mojom::ArcPackageInfo>& fake_packages() const {
55 return fake_packages_; 55 return fake_packages_;
56 } 56 }
57 57
58 void AddPackage(const arc::mojom::ArcPackageInfo& package); 58 void AddPackage(const arc::mojom::ArcPackageInfo& package);
59 59
60 void RemovePackage(const arc::mojom::ArcPackageInfo& package); 60 void RemovePackage(const arc::mojom::ArcPackageInfo& package);
61 61
62 void WaitForDefaultApps();
63
62 // The 0th item is sticky but not the followings. 64 // The 0th item is sticky but not the followings.
63 const std::vector<arc::mojom::AppInfo>& fake_apps() const { 65 const std::vector<arc::mojom::AppInfo>& fake_apps() const {
64 return fake_apps_; 66 return fake_apps_;
65 } 67 }
66 68
67 const std::vector<arc::mojom::AppInfo>& fake_default_apps() const { 69 const std::vector<arc::mojom::AppInfo>& fake_default_apps() const {
68 return fake_default_apps_; 70 return fake_default_apps_;
69 } 71 }
70 72
71 const std::vector<arc::mojom::ShortcutInfo>& fake_shortcuts() const { 73 const std::vector<arc::mojom::ShortcutInfo>& fake_shortcuts() const {
72 return fake_shortcuts_; 74 return fake_shortcuts_;
73 } 75 }
74 76
75 chromeos::FakeChromeUserManager* GetUserManager(); 77 chromeos::FakeChromeUserManager* GetUserManager();
76 78
77 arc::FakeAppInstance* app_instance() { return app_instance_.get(); } 79 arc::FakeAppInstance* app_instance() { return app_instance_.get(); }
78 80
79 ArcAppListPrefs* arc_app_list_prefs() { return arc_app_list_pref_; } 81 ArcAppListPrefs* arc_app_list_prefs() { return arc_app_list_pref_; }
80 82
81 arc::ArcSessionManager* arc_session_manager() { 83 arc::ArcSessionManager* arc_session_manager() {
82 return arc_session_manager_.get(); 84 return arc_session_manager_.get();
83 } 85 }
84 arc::ArcServiceManager* arc_service_manager() { 86 arc::ArcServiceManager* arc_service_manager() {
85 return arc_service_manager_.get(); 87 return arc_service_manager_.get();
86 } 88 }
87 89
90 void set_wait_default_apps(bool wait_default_apps) {
91 wait_default_apps_ = wait_default_apps;
92 }
93
88 private: 94 private:
89 const user_manager::User* CreateUserAndLogin(); 95 const user_manager::User* CreateUserAndLogin();
90 bool FindPackage(const arc::mojom::ArcPackageInfo& package); 96 bool FindPackage(const arc::mojom::ArcPackageInfo& package);
91 void CreateFakeAppsAndPackages(); 97 void CreateFakeAppsAndPackages();
92 98
93 // Unowned pointer. 99 // Unowned pointer.
94 Profile* profile_ = nullptr; 100 Profile* profile_ = nullptr;
95 101
96 ArcAppListPrefs* arc_app_list_pref_ = nullptr; 102 ArcAppListPrefs* arc_app_list_pref_ = nullptr;
97 103
104 bool wait_default_apps_ = true;
105
98 std::unique_ptr<arc::ArcServiceManager> arc_service_manager_; 106 std::unique_ptr<arc::ArcServiceManager> arc_service_manager_;
99 std::unique_ptr<arc::ArcSessionManager> arc_session_manager_; 107 std::unique_ptr<arc::ArcSessionManager> arc_session_manager_;
100 std::unique_ptr<arc::ArcPlayStoreEnabledPreferenceHandler> 108 std::unique_ptr<arc::ArcPlayStoreEnabledPreferenceHandler>
101 arc_play_store_enabled_preference_handler_; 109 arc_play_store_enabled_preference_handler_;
102 std::unique_ptr<arc::FakeAppInstance> app_instance_; 110 std::unique_ptr<arc::FakeAppInstance> app_instance_;
103 111
104 std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; 112 std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_;
105 std::vector<arc::mojom::AppInfo> fake_apps_; 113 std::vector<arc::mojom::AppInfo> fake_apps_;
106 std::vector<arc::mojom::AppInfo> fake_default_apps_; 114 std::vector<arc::mojom::AppInfo> fake_default_apps_;
107 std::vector<arc::mojom::ArcPackageInfo> fake_packages_; 115 std::vector<arc::mojom::ArcPackageInfo> fake_packages_;
108 std::vector<arc::mojom::ShortcutInfo> fake_shortcuts_; 116 std::vector<arc::mojom::ShortcutInfo> fake_shortcuts_;
109 117
110 bool dbus_thread_manager_initialized_ = false; 118 bool dbus_thread_manager_initialized_ = false;
111 119
112 DISALLOW_COPY_AND_ASSIGN(ArcAppTest); 120 DISALLOW_COPY_AND_ASSIGN(ArcAppTest);
113 }; 121 };
114 122
115 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_ 123 #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.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