| 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 #include <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 service_->GetBootstrapForTesting()); | 51 service_->GetBootstrapForTesting()); |
| 52 } | 52 } |
| 53 | 53 |
| 54 protected: | 54 protected: |
| 55 std::unique_ptr<ArcBridgeServiceImpl> service_; | 55 std::unique_ptr<ArcBridgeServiceImpl> service_; |
| 56 ArcBridgeService::StopReason stop_reason_; | 56 ArcBridgeService::StopReason stop_reason_; |
| 57 | 57 |
| 58 static std::unique_ptr<ArcBridgeBootstrap> CreateSuspendedBootstrap() { | 58 static std::unique_ptr<ArcBridgeBootstrap> CreateSuspendedBootstrap() { |
| 59 auto bootstrap = base::MakeUnique<FakeArcBridgeBootstrap>(); | 59 auto bootstrap = base::MakeUnique<FakeArcBridgeBootstrap>(); |
| 60 bootstrap->SuspendBoot(); | 60 bootstrap->SuspendBoot(); |
| 61 return bootstrap; | 61 return std::move(bootstrap); |
| 62 } | 62 } |
| 63 | 63 |
| 64 static std::unique_ptr<ArcBridgeBootstrap> CreateBootFailureBootstrap( | 64 static std::unique_ptr<ArcBridgeBootstrap> CreateBootFailureBootstrap( |
| 65 ArcBridgeService::StopReason reason) { | 65 ArcBridgeService::StopReason reason) { |
| 66 auto bootstrap = base::MakeUnique<FakeArcBridgeBootstrap>(); | 66 auto bootstrap = base::MakeUnique<FakeArcBridgeBootstrap>(); |
| 67 bootstrap->EnableBootFailureEmulation(reason); | 67 bootstrap->EnableBootFailureEmulation(reason); |
| 68 return bootstrap; | 68 return std::move(bootstrap); |
| 69 } | 69 } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 void SetUp() override { | 72 void SetUp() override { |
| 73 chromeos::DBusThreadManager::Initialize(); | 73 chromeos::DBusThreadManager::Initialize(); |
| 74 | 74 |
| 75 ready_ = false; | 75 ready_ = false; |
| 76 state_ = ArcBridgeService::State::STOPPED; | 76 state_ = ArcBridgeService::State::STOPPED; |
| 77 stop_reason_ = ArcBridgeService::StopReason::SHUTDOWN; | 77 stop_reason_ = ArcBridgeService::StopReason::SHUTDOWN; |
| 78 | 78 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 } | 192 } |
| 193 | 193 |
| 194 // Removing an unknown observer should be allowed. | 194 // Removing an unknown observer should be allowed. |
| 195 TEST_F(ArcBridgeTest, RemoveUnknownObserver) { | 195 TEST_F(ArcBridgeTest, RemoveUnknownObserver) { |
| 196 ASSERT_FALSE(ready()); | 196 ASSERT_FALSE(ready()); |
| 197 auto dummy_observer = base::MakeUnique<DummyObserver>(); | 197 auto dummy_observer = base::MakeUnique<DummyObserver>(); |
| 198 service_->RemoveObserver(dummy_observer.get()); | 198 service_->RemoveObserver(dummy_observer.get()); |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace arc | 201 } // namespace arc |
| OLD | NEW |