OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "device/bluetooth/test/mock_bluetooth_adapter.h" | 7 #include "device/bluetooth/test/mock_bluetooth_adapter.h" |
8 #include "device/bluetooth/test/mock_bluetooth_device.h" | 8 #include "device/bluetooth/test/mock_bluetooth_device.h" |
9 #include "device/bluetooth/test/mock_bluetooth_gatt_characteristic.h" | 9 #include "device/bluetooth/test/mock_bluetooth_gatt_characteristic.h" |
10 #include "device/bluetooth/test/mock_bluetooth_gatt_connection.h" | 10 #include "device/bluetooth/test/mock_bluetooth_gatt_connection.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 const char kTestDescriptorId1[] = "desc_id1"; | 88 const char kTestDescriptorId1[] = "desc_id1"; |
89 const char kTestDescriptorUuid1[] = "1222"; | 89 const char kTestDescriptorUuid1[] = "1222"; |
90 const uint8 kTestDescriptorDefaultValue1[] = {0x04, 0x05}; | 90 const uint8 kTestDescriptorDefaultValue1[] = {0x04, 0x05}; |
91 | 91 |
92 class BluetoothLowEnergyApiTest : public ExtensionApiTest { | 92 class BluetoothLowEnergyApiTest : public ExtensionApiTest { |
93 public: | 93 public: |
94 BluetoothLowEnergyApiTest() {} | 94 BluetoothLowEnergyApiTest() {} |
95 | 95 |
96 virtual ~BluetoothLowEnergyApiTest() {} | 96 virtual ~BluetoothLowEnergyApiTest() {} |
97 | 97 |
98 virtual void SetUpOnMainThread() OVERRIDE { | 98 virtual void SetUpOnMainThread() override { |
99 ExtensionApiTest::SetUpOnMainThread(); | 99 ExtensionApiTest::SetUpOnMainThread(); |
100 empty_extension_ = extensions::test_util::CreateEmptyExtension(); | 100 empty_extension_ = extensions::test_util::CreateEmptyExtension(); |
101 SetUpMocks(); | 101 SetUpMocks(); |
102 } | 102 } |
103 | 103 |
104 virtual void TearDownOnMainThread() OVERRIDE { | 104 virtual void TearDownOnMainThread() override { |
105 EXPECT_CALL(*mock_adapter_, RemoveObserver(_)); | 105 EXPECT_CALL(*mock_adapter_, RemoveObserver(_)); |
106 } | 106 } |
107 | 107 |
108 void SetUpMocks() { | 108 void SetUpMocks() { |
109 mock_adapter_ = new testing::StrictMock<MockBluetoothAdapter>(); | 109 mock_adapter_ = new testing::StrictMock<MockBluetoothAdapter>(); |
110 EXPECT_CALL(*mock_adapter_, GetDevices()) | 110 EXPECT_CALL(*mock_adapter_, GetDevices()) |
111 .WillOnce(Return(BluetoothAdapter::ConstDeviceList())); | 111 .WillOnce(Return(BluetoothAdapter::ConstDeviceList())); |
112 | 112 |
113 event_router()->SetAdapterForTesting(mock_adapter_); | 113 event_router()->SetAdapterForTesting(mock_adapter_); |
114 | 114 |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc2_.get()); | 1295 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc2_.get()); |
1296 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc1_.get()); | 1296 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc1_.get()); |
1297 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); | 1297 event_router()->GattCharacteristicRemoved(mock_adapter_, chrc0_.get()); |
1298 event_router()->GattServiceRemoved( | 1298 event_router()->GattServiceRemoved( |
1299 mock_adapter_, device0_.get(), service1_.get()); | 1299 mock_adapter_, device0_.get(), service1_.get()); |
1300 event_router()->GattServiceRemoved( | 1300 event_router()->GattServiceRemoved( |
1301 mock_adapter_, device0_.get(), service0_.get()); | 1301 mock_adapter_, device0_.get(), service0_.get()); |
1302 } | 1302 } |
1303 | 1303 |
1304 } // namespace | 1304 } // namespace |
OLD | NEW |