Index: components/arc/test/fake_arc_bridge_service.h |
diff --git a/components/arc/test/fake_arc_bridge_service.h b/components/arc/test/fake_arc_bridge_service.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..28f42e10a2da69d1bca2dbe0ccc1342484069626 |
--- /dev/null |
+++ b/components/arc/test/fake_arc_bridge_service.h |
@@ -0,0 +1,80 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_ARC_BRIDGE_SERVICE_FOR_APP_LAUNCHER_H_ |
Luis Héctor Chávez
2015/11/18 18:22:19
COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_SERVICE_H
khmel1
2015/11/19 02:56:13
Done.
|
+#define CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_ARC_BRIDGE_SERVICE_FOR_APP_LAUNCHER_H_ |
+ |
+#include <string> |
+#include <vector> |
+ |
+#include "base/macros.h" |
+#include "components/arc/arc_bridge_service.h" |
+#include "ui/base/layout.h" |
+ |
+class FakeArcBridgeService : public arc::ArcBridgeService { |
+ public: |
+ struct AppInfo { |
+ std::string id() const; |
+ |
+ const char* name; |
+ const char* package; |
+ const char* activity; |
+ }; |
+ |
+ struct IconRequest { |
+ std::string package; |
+ std::string activity; |
+ int scale_factor; |
+ }; |
+ |
+ FakeArcBridgeService(); |
+ ~FakeArcBridgeService() override; |
+ |
+ // arc::ArcBridgeService |
+ void HandleStartup() override; |
+ void Shutdown() override; |
+ bool RegisterInputDevice(const std::string& name, |
+ const std::string& device_type, |
+ base::ScopedFD fd) override; |
+ bool RefreshApps() override; |
+ bool LaunchApp(const std::string& package, |
+ const std::string& activity) override; |
+ bool RequestIcon(const std::string& package, |
+ const std::string& activity, |
+ int scale_factor) override; |
+ |
+ int refresh_apps_cnt() const { return refresh_apps_cnt_; } |
Luis Héctor Chávez
2015/11/18 18:22:19
As before, don't abbreviate 'count'.
|
+ |
+ const std::vector<std::string>& launch_requests() const { |
+ return launch_requests_; |
+ } |
+ |
+ const std::vector<IconRequest>& icon_requests() const { |
+ return icon_requests_; |
+ } |
+ |
+ void SetReady(); |
+ |
+ void SetStopped(); |
+ |
+ bool HasObserver(const Observer* observer) const; |
+ |
+ void SendRefreshApps(size_t size, const AppInfo* apps); |
+ |
+ bool GenerateAndSendIcon(const AppInfo& app, |
+ ui::ScaleFactor scale_factor, |
+ std::vector<unsigned char>* png_data); |
+ |
+ private: |
+ // Number of RefreshApps calls. |
+ int refresh_apps_cnt_; |
+ // Keeps information about launch requests. |
+ std::vector<std::string> launch_requests_; |
+ // Keeps information about icon load requests. |
+ std::vector<IconRequest> icon_requests_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeService); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_ARC_BRIDGE_SERVICE_FOR_APP_LAUNCHER_H_ |