Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 25 matching lines...) Expand all Loading... | |
| 36 | 36 |
| 37 // Helper class to initialize arc bridge to work with arc apps in unit tests. | 37 // Helper class to initialize arc bridge to work with arc apps in unit tests. |
| 38 class ArcAppTest { | 38 class ArcAppTest { |
| 39 public: | 39 public: |
| 40 ArcAppTest(); | 40 ArcAppTest(); |
| 41 virtual ~ArcAppTest(); | 41 virtual ~ArcAppTest(); |
| 42 | 42 |
| 43 void SetUp(Profile* profile); | 43 void SetUp(Profile* profile); |
| 44 void TearDown(); | 44 void TearDown(); |
| 45 | 45 |
| 46 // AppInstance is destoryed after bridge stops and InstanceHolder:: | |
| 47 // CloseChannl(). Reset AppInstance to continue unit_tests. | |
|
Luis Héctor Chávez
2016/07/20 00:01:15
nit: CloseChannel()
lgcheng
2016/07/20 01:23:58
Done.
| |
| 48 void ResetAppInstance(); | |
| 49 | |
| 46 static std::string GetAppId(const arc::mojom::AppInfo& app_info); | 50 static std::string GetAppId(const arc::mojom::AppInfo& app_info); |
| 47 static std::string GetAppId(const arc::mojom::ShortcutInfo& shortcut); | 51 static std::string GetAppId(const arc::mojom::ShortcutInfo& shortcut); |
| 48 | 52 |
| 49 const std::vector<arc::mojom::ArcPackageInfo>& fake_packages() const { | 53 const std::vector<arc::mojom::ArcPackageInfo>& fake_packages() const { |
| 50 return fake_packages_; | 54 return fake_packages_; |
| 51 } | 55 } |
| 52 | 56 |
| 53 void AddPackage(const arc::mojom::ArcPackageInfo& package); | 57 void AddPackage(const arc::mojom::ArcPackageInfo& package); |
| 54 | 58 |
| 55 void RemovePackage(const arc::mojom::ArcPackageInfo& package); | 59 void RemovePackage(const arc::mojom::ArcPackageInfo& package); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 std::unique_ptr<arc::ArcAuthService> auth_service_; | 91 std::unique_ptr<arc::ArcAuthService> auth_service_; |
| 88 std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; | 92 std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; |
| 89 std::vector<arc::mojom::AppInfo> fake_apps_; | 93 std::vector<arc::mojom::AppInfo> fake_apps_; |
| 90 std::vector<arc::mojom::ArcPackageInfo> fake_packages_; | 94 std::vector<arc::mojom::ArcPackageInfo> fake_packages_; |
| 91 std::vector<arc::mojom::ShortcutInfo> fake_shortcuts_; | 95 std::vector<arc::mojom::ShortcutInfo> fake_shortcuts_; |
| 92 | 96 |
| 93 DISALLOW_COPY_AND_ASSIGN(ArcAppTest); | 97 DISALLOW_COPY_AND_ASSIGN(ArcAppTest); |
| 94 }; | 98 }; |
| 95 | 99 |
| 96 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_ | 100 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_ |
| OLD | NEW |