| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_ | 5 #ifndef COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_ |
| 6 #define COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_ | 6 #define COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/arc/arc_bridge_service.h" | 9 #include "components/arc/arc_bridge_service.h" |
| 10 #include "components/arc/common/arc_bridge.mojom.h" | 10 #include "components/arc/common/arc_bridge.mojom.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // ArcBridgeInstance: | 35 // ArcBridgeInstance: |
| 36 void Init(mojom::ArcBridgeHostPtr host) override; | 36 void Init(mojom::ArcBridgeHostPtr host) override; |
| 37 | 37 |
| 38 // Ensures the call to Init() has been dispatched. | 38 // Ensures the call to Init() has been dispatched. |
| 39 void WaitForInitCall(); | 39 void WaitForInitCall(); |
| 40 | 40 |
| 41 // The number of times Init() has been called. | 41 // The number of times Init() has been called. |
| 42 int init_calls() const { return init_calls_; } | 42 int init_calls() const { return init_calls_; } |
| 43 | 43 |
| 44 // Simulates a crash by calling Stop() on the ArcBridgeBoostrap. | 44 // Simulates a crash. |
| 45 void SimulateCrash(); | 45 void SimulateCrash(); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 Delegate* delegate_ = nullptr; | 48 Delegate* delegate_ = nullptr; |
| 49 | 49 |
| 50 // Mojo endpoints. | 50 // Mojo endpoints. |
| 51 mojo::Binding<mojom::ArcBridgeInstance> binding_; | 51 mojo::Binding<mojom::ArcBridgeInstance> binding_; |
| 52 mojom::ArcBridgeHostPtr host_ptr_; | 52 mojom::ArcBridgeHostPtr host_ptr_; |
| 53 int init_calls_ = 0; | 53 int init_calls_ = 0; |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeInstance); | 55 DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeInstance); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 } // namespace arc | 58 } // namespace arc |
| 59 | 59 |
| 60 #endif // COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_ | 60 #endif // COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_ |
| OLD | NEW |