| Index: components/arc/test/fake_arc_bridge_bootstrap.h
|
| diff --git a/components/arc/test/fake_arc_bridge_bootstrap.h b/components/arc/test/fake_arc_bridge_bootstrap.h
|
| index edc5c1b7f11363cdadcf1c27aa53a0a0556f346f..38e06d64d2892f77a23264672bbfb6b279b86d67 100644
|
| --- a/components/arc/test/fake_arc_bridge_bootstrap.h
|
| +++ b/components/arc/test/fake_arc_bridge_bootstrap.h
|
| @@ -7,27 +7,36 @@
|
|
|
| #include "base/macros.h"
|
| #include "components/arc/arc_bridge_bootstrap.h"
|
| -#include "components/arc/test/fake_arc_bridge_instance.h"
|
|
|
| namespace arc {
|
|
|
| // A fake ArcBridgeBootstrap that creates a local connection.
|
| -class FakeArcBridgeBootstrap : public ArcBridgeBootstrap,
|
| - public FakeArcBridgeInstance::Delegate {
|
| +class FakeArcBridgeBootstrap : public ArcBridgeBootstrap {
|
| public:
|
| - explicit FakeArcBridgeBootstrap(FakeArcBridgeInstance* instance);
|
| - ~FakeArcBridgeBootstrap() override = default;
|
| + FakeArcBridgeBootstrap();
|
| + ~FakeArcBridgeBootstrap() override;
|
|
|
| // ArcBridgeBootstrap:
|
| void Start() override;
|
| void Stop() override;
|
|
|
| + // To emulate unexpected stop, such as crash.
|
| + void StopWithReason(ArcBridgeService::StopReason reason);
|
| +
|
| + // Follows control Start() behavior for testing various situations.
|
| +
|
| + // Enables/disables boot failure emulation, in which OnStopped(reason) will
|
| + // be called when Start() is called.
|
| + void EnableBootFailureEmulation(ArcBridgeService::StopReason reason);
|
| +
|
| + // Emulate Start() is suspended at some phase, before OnReady() is invoked.
|
| + void SuspendBoot();
|
| +
|
| private:
|
| - // FakeArcBridgeInstance::Delegate:
|
| - void OnStopped(ArcBridgeService::StopReason reason) override;
|
| + bool boot_failure_emulation_enabled_ = false;
|
| + ArcBridgeService::StopReason boot_failure_reason_;
|
|
|
| - // Owned by the caller.
|
| - FakeArcBridgeInstance* instance_;
|
| + bool boot_suspended_ = false;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeBootstrap);
|
| };
|
|
|