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 // Public methods to set bridge status for unit_tests. | |
| 47 void SetBridgeServiceStopped(); | |
| 48 // AppInstance is destoryed after bridge stops and InstanceHolder:: | |
|
Luis Héctor Chávez
2016/07/25 20:50:54
nit: s/destoryed/destroyed/
lgcheng
2016/07/25 21:10:11
Done.
| |
| 49 // CloseChannel(). Reset AppInstance to continue unit_tests. | |
| 50 void ResetBridgeServiceReady(); | |
| 51 | |
| 46 static std::string GetAppId(const arc::mojom::AppInfo& app_info); | 52 static std::string GetAppId(const arc::mojom::AppInfo& app_info); |
| 47 static std::string GetAppId(const arc::mojom::ShortcutInfo& shortcut); | 53 static std::string GetAppId(const arc::mojom::ShortcutInfo& shortcut); |
| 48 | 54 |
| 49 const std::vector<arc::mojom::ArcPackageInfo>& fake_packages() const { | 55 const std::vector<arc::mojom::ArcPackageInfo>& fake_packages() const { |
| 50 return fake_packages_; | 56 return fake_packages_; |
| 51 } | 57 } |
| 52 | 58 |
| 53 void AddPackage(const arc::mojom::ArcPackageInfo& package); | 59 void AddPackage(const arc::mojom::ArcPackageInfo& package); |
| 54 | 60 |
| 55 void RemovePackage(const arc::mojom::ArcPackageInfo& package); | 61 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_; | 93 std::unique_ptr<arc::ArcAuthService> auth_service_; |
| 88 std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; | 94 std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_; |
| 89 std::vector<arc::mojom::AppInfo> fake_apps_; | 95 std::vector<arc::mojom::AppInfo> fake_apps_; |
| 90 std::vector<arc::mojom::ArcPackageInfo> fake_packages_; | 96 std::vector<arc::mojom::ArcPackageInfo> fake_packages_; |
| 91 std::vector<arc::mojom::ShortcutInfo> fake_shortcuts_; | 97 std::vector<arc::mojom::ShortcutInfo> fake_shortcuts_; |
| 92 | 98 |
| 93 DISALLOW_COPY_AND_ASSIGN(ArcAppTest); | 99 DISALLOW_COPY_AND_ASSIGN(ArcAppTest); |
| 94 }; | 100 }; |
| 95 | 101 |
| 96 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_ | 102 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_ |
| OLD | NEW |