| 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..d00ac661b30fa6008cb0e396b80c19673312d9c3
|
| --- /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 COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_SERVICE_H_
|
| +#define COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_SERVICE_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_count() const { return refresh_apps_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_count_;
|
| + // 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 // COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_SERVICE_H_
|
|
|