Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: components/arc/test/fake_arc_bridge_service.cc

Issue 2078263002: Example Bluetooth ARC++ test changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@arc_tests
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/arc/test/fake_arc_bridge_service.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/arc/test/fake_arc_bridge_service.h" 5 #include "components/arc/test/fake_arc_bridge_service.h"
6 6
7 namespace arc { 7 namespace arc {
8 8
9 FakeArcBridgeService::FakeArcBridgeService() { 9 FakeArcBridgeService::FakeArcBridgeService()
10 } 10 : bluetooth_instance_(base::WrapUnique(new FakeBluetoothInstance())),
11 bluetooth_version_(1) {}
11 12
12 FakeArcBridgeService::~FakeArcBridgeService() { 13 FakeArcBridgeService::~FakeArcBridgeService() {
13 SetStopped(); 14 SetStopped();
14 } 15 }
15 16
16 void FakeArcBridgeService::SetDetectedAvailability(bool availability) { 17 void FakeArcBridgeService::SetDetectedAvailability(bool availability) {
17 SetAvailable(availability); 18 SetAvailable(availability);
18 } 19 }
19 20
20 void FakeArcBridgeService::HandleStartup() { 21 void FakeArcBridgeService::HandleStartup() {
21 SetReady(); 22 SetReady();
22 } 23 }
23 24
24 void FakeArcBridgeService::Shutdown() { 25 void FakeArcBridgeService::Shutdown() {
25 SetStopped(); 26 SetStopped();
26 } 27 }
27 28
29 mojom::BluetoothInstance* FakeArcBridgeService::bluetooth_instance() {
30 return bluetooth_instance_.get();
31 }
32
33 int32_t FakeArcBridgeService::bluetooth_version() const {
34 return bluetooth_version_;
35 }
36
28 void FakeArcBridgeService::SetReady() { 37 void FakeArcBridgeService::SetReady() {
29 if (state() != State::READY) 38 if (state() != State::READY)
30 SetState(State::READY); 39 SetState(State::READY);
31 } 40 }
32 41
33 void FakeArcBridgeService::SetStopped() { 42 void FakeArcBridgeService::SetStopped() {
34 if (state() != State::STOPPED) 43 if (state() != State::STOPPED)
35 SetState(State::STOPPED); 44 SetState(State::STOPPED);
36 } 45 }
37 46
38 bool FakeArcBridgeService::HasObserver(const Observer* observer) { 47 bool FakeArcBridgeService::HasObserver(const Observer* observer) {
39 return observer_list().HasObserver(observer); 48 return observer_list().HasObserver(observer);
40 } 49 }
41 50
42 } // namespace arc 51 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/test/fake_arc_bridge_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698