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 #include "device/bluetooth/test/bluetooth_gatt_server_test.h" | 5 #include "device/bluetooth/test/bluetooth_gatt_server_test.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "device/bluetooth/bluetooth_uuid.h" | 10 #include "device/bluetooth/bluetooth_uuid.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 void BluetoothGattServerTest::CompleteGattSetup() { | 26 void BluetoothGattServerTest::CompleteGattSetup() { |
27 service_->Register(GetCallback(Call::EXPECTED), | 27 service_->Register(GetCallback(Call::EXPECTED), |
28 GetGattErrorCallback(Call::NOT_EXPECTED)); | 28 GetGattErrorCallback(Call::NOT_EXPECTED)); |
29 } | 29 } |
30 | 30 |
31 void BluetoothGattServerTest::SetUp() { | 31 void BluetoothGattServerTest::SetUp() { |
32 BluetoothTest::SetUp(); | 32 BluetoothTest::SetUp(); |
33 last_read_value_ = std::vector<uint8_t>(); | 33 last_read_value_ = std::vector<uint8_t>(); |
34 InitWithFakeAdapter(); | 34 InitWithFakeAdapter(); |
35 delegate_ = base::WrapUnique(new TestBluetoothLocalGattServiceDelegate()); | 35 delegate_ = base::MakeUnique<TestBluetoothLocalGattServiceDelegate>(); |
36 } | 36 } |
37 | 37 |
38 void BluetoothGattServerTest::TearDown() { | 38 void BluetoothGattServerTest::TearDown() { |
39 if (service_.get()) | 39 if (service_.get()) |
40 service_->Delete(); | 40 service_->Delete(); |
41 delegate_.reset(); | 41 delegate_.reset(); |
42 BluetoothTest::TearDown(); | 42 BluetoothTest::TearDown(); |
43 } | 43 } |
44 | 44 |
45 // static | 45 // static |
(...skipping 15 matching lines...) Expand all Loading... |
61 CHECK_LE(int_value, 0xFFFFFFFFul); | 61 CHECK_LE(int_value, 0xFFFFFFFFul); |
62 std::vector<uint8_t> value; | 62 std::vector<uint8_t> value; |
63 while (int_value) { | 63 while (int_value) { |
64 value.push_back(int_value & 0xff); | 64 value.push_back(int_value & 0xff); |
65 int_value >>= 8; | 65 int_value >>= 8; |
66 } | 66 } |
67 return value; | 67 return value; |
68 } | 68 } |
69 | 69 |
70 } // namespace device | 70 } // namespace device |
OLD | NEW |