OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_BOOTSTRAP_H_ | 5 #ifndef COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_BOOTSTRAP_H_ |
6 #define COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_BOOTSTRAP_H_ | 6 #define COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_BOOTSTRAP_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "components/arc/arc_bridge_bootstrap.h" | 11 #include "components/arc/arc_bridge_bootstrap.h" |
12 #include "components/arc/test/fake_arc_bridge_instance.h" | |
13 | 12 |
14 namespace arc { | 13 namespace arc { |
15 | 14 |
16 // A fake ArcBridgeBootstrap that creates a local connection. | 15 // A fake ArcBridgeBootstrap that creates a local connection. |
17 class FakeArcBridgeBootstrap : public ArcBridgeBootstrap { | 16 class FakeArcBridgeBootstrap : public ArcBridgeBootstrap { |
18 public: | 17 public: |
19 FakeArcBridgeBootstrap(); | 18 FakeArcBridgeBootstrap(); |
20 ~FakeArcBridgeBootstrap() override; | 19 ~FakeArcBridgeBootstrap() override; |
21 | 20 |
22 // ArcBridgeBootstrap: | 21 // ArcBridgeBootstrap: |
(...skipping 12 matching lines...) Expand all Loading... |
35 // Emulate Start() is suspended at some phase, before OnReady() is invoked. | 34 // Emulate Start() is suspended at some phase, before OnReady() is invoked. |
36 void SuspendBoot(); | 35 void SuspendBoot(); |
37 | 36 |
38 // Returns FakeArcBridgeBootstrap instance. This can be used for a factory | 37 // Returns FakeArcBridgeBootstrap instance. This can be used for a factory |
39 // in ArcBridgeServiceImpl. | 38 // in ArcBridgeServiceImpl. |
40 static std::unique_ptr<ArcBridgeBootstrap> Create(); | 39 static std::unique_ptr<ArcBridgeBootstrap> Create(); |
41 | 40 |
42 private: | 41 private: |
43 bool boot_failure_emulation_enabled_ = false; | 42 bool boot_failure_emulation_enabled_ = false; |
44 ArcBridgeService::StopReason boot_failure_reason_; | 43 ArcBridgeService::StopReason boot_failure_reason_; |
45 FakeArcBridgeInstance instance_; | |
46 | 44 |
47 bool boot_suspended_ = false; | 45 bool boot_suspended_ = false; |
48 | 46 |
49 DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeBootstrap); | 47 DISALLOW_COPY_AND_ASSIGN(FakeArcBridgeBootstrap); |
50 }; | 48 }; |
51 | 49 |
52 } // namespace arc | 50 } // namespace arc |
53 | 51 |
54 #endif // COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_BOOTSTRAP_H_ | 52 #endif // COMPONENTS_ARC_TEST_FAKE_ARC_BRIDGE_BOOTSTRAP_H_ |
OLD | NEW |