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/callback_forward.h" |
8 #include "base/macros.h" | 9 #include "base/macros.h" |
9 #include "components/arc/arc_bridge_service.h" | 10 #include "components/arc/arc_bridge_service.h" |
10 #include "components/arc/common/arc_bridge.mojom.h" | 11 #include "components/arc/common/arc_bridge.mojom.h" |
11 #include "mojo/public/cpp/bindings/binding.h" | 12 #include "mojo/public/cpp/bindings/binding.h" |
12 | 13 |
13 namespace arc { | 14 namespace arc { |
14 | 15 |
15 class FakeArcBridgeInstance : public mojom::ArcBridgeInstance { | 16 class FakeArcBridgeInstance : public mojom::ArcBridgeInstance { |
16 public: | 17 public: |
17 class Delegate { | 18 class Delegate { |
(...skipping 22 matching lines...) Expand all Loading... |
40 | 41 |
41 // The number of times Init() has been called. | 42 // The number of times Init() has been called. |
42 int init_calls() const { return init_calls_; } | 43 int init_calls() const { return init_calls_; } |
43 | 44 |
44 // Stops the instance. | 45 // Stops the instance. |
45 void Stop(ArcBridgeService::StopReason reason); | 46 void Stop(ArcBridgeService::StopReason reason); |
46 | 47 |
47 private: | 48 private: |
48 Delegate* delegate_ = nullptr; | 49 Delegate* delegate_ = nullptr; |
49 | 50 |
| 51 // Keeps quit closure to wake the running nested RunLoop. |
| 52 base::Closure quit_closure_; |
| 53 |
50 // Mojo endpoints. | 54 // Mojo endpoints. |
51 mojo::Binding<mojom::ArcBridgeInstance> binding_; | 55 mojo::Binding<mojom::ArcBridgeInstance> binding_; |
52 mojom::ArcBridgeHostPtr host_ptr_; | 56 mojom::ArcBridgeHostPtr host_ptr_; |
53 int init_calls_ = 0; | 57 int init_calls_ = 0; |
54 | 58 |
55 DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeInstance); | 59 DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeInstance); |
56 }; | 60 }; |
57 | 61 |
58 } // namespace arc | 62 } // namespace arc |
59 | 63 |
60 #endif // COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_ | 64 #endif // COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_INSTANCE_H_ |
OLD | NEW |