| 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> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 | 13 |
| 14 namespace arc { | 14 namespace arc { |
| 15 namespace mojom { |
| 15 class AppInfo; | 16 class AppInfo; |
| 17 } |
| 16 class FakeArcBridgeService; | 18 class FakeArcBridgeService; |
| 17 class FakeAppInstance; | 19 class FakeAppInstance; |
| 18 } | 20 } |
| 19 | 21 |
| 20 namespace content { | 22 namespace content { |
| 21 class BrowserContext; | 23 class BrowserContext; |
| 22 } | 24 } |
| 23 | 25 |
| 24 // Helper class to initialize arc bridge to work with arc apps in unit tests. | 26 // Helper class to initialize arc bridge to work with arc apps in unit tests. |
| 25 class ArcAppTest { | 27 class ArcAppTest { |
| 26 public: | 28 public: |
| 27 ArcAppTest(); | 29 ArcAppTest(); |
| 28 virtual ~ArcAppTest(); | 30 virtual ~ArcAppTest(); |
| 29 | 31 |
| 30 void SetUp(content::BrowserContext* browser_context); | 32 void SetUp(content::BrowserContext* browser_context); |
| 31 | 33 |
| 32 static std::string GetAppId(const arc::AppInfo& app_info); | 34 static std::string GetAppId(const arc::mojom::AppInfo& app_info); |
| 33 | 35 |
| 34 // The 0th item is sticky but not the followings. | 36 // The 0th item is sticky but not the followings. |
| 35 const std::vector<arc::AppInfo>& fake_apps() const { return fake_apps_; } | 37 const std::vector<arc::mojom::AppInfo>& fake_apps() const { |
| 38 return fake_apps_; |
| 39 } |
| 36 | 40 |
| 37 arc::FakeArcBridgeService* bridge_service() { return bridge_service_.get(); } | 41 arc::FakeArcBridgeService* bridge_service() { return bridge_service_.get(); } |
| 38 | 42 |
| 39 arc::FakeAppInstance* app_instance() { return app_instance_.get(); } | 43 arc::FakeAppInstance* app_instance() { return app_instance_.get(); } |
| 40 | 44 |
| 41 private: | 45 private: |
| 42 // Unowned pointer. | 46 // Unowned pointer. |
| 43 content::BrowserContext* browser_context_ = nullptr; | 47 content::BrowserContext* browser_context_ = nullptr; |
| 44 | 48 |
| 45 std::unique_ptr<arc::FakeArcBridgeService> bridge_service_; | 49 std::unique_ptr<arc::FakeArcBridgeService> bridge_service_; |
| 46 std::unique_ptr<arc::FakeAppInstance> app_instance_; | 50 std::unique_ptr<arc::FakeAppInstance> app_instance_; |
| 47 std::vector<arc::AppInfo> fake_apps_; | 51 std::vector<arc::mojom::AppInfo> fake_apps_; |
| 48 | 52 |
| 49 DISALLOW_COPY_AND_ASSIGN(ArcAppTest); | 53 DISALLOW_COPY_AND_ASSIGN(ArcAppTest); |
| 50 }; | 54 }; |
| 51 | 55 |
| 52 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_ | 56 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_TEST_H_ |
| OLD | NEW |