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 "components/proximity_auth/bluetooth_connection.h" | 5 #include "components/proximity_auth/bluetooth_connection.h" |
6 | 6 |
| 7 #include "base/macros.h" |
7 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
8 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
9 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
10 #include "components/proximity_auth/proximity_auth_test_util.h" | 11 #include "components/proximity_auth/proximity_auth_test_util.h" |
11 #include "components/proximity_auth/remote_device.h" | 12 #include "components/proximity_auth/remote_device.h" |
12 #include "components/proximity_auth/wire_message.h" | 13 #include "components/proximity_auth/wire_message.h" |
13 #include "device/bluetooth/bluetooth_adapter_factory.h" | 14 #include "device/bluetooth/bluetooth_adapter_factory.h" |
14 #include "device/bluetooth/bluetooth_uuid.h" | 15 #include "device/bluetooth/bluetooth_uuid.h" |
15 #include "device/bluetooth/test/mock_bluetooth_adapter.h" | 16 #include "device/bluetooth/test/mock_bluetooth_adapter.h" |
16 #include "device/bluetooth/test/mock_bluetooth_device.h" | 17 #include "device/bluetooth/test/mock_bluetooth_device.h" |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 EXPECT_TRUE(connection.IsConnected()); | 477 EXPECT_TRUE(connection.IsConnected()); |
477 connection.DeviceChanged(adapter_.get(), &device_); | 478 connection.DeviceChanged(adapter_.get(), &device_); |
478 EXPECT_TRUE(connection.IsConnected()); | 479 EXPECT_TRUE(connection.IsConnected()); |
479 | 480 |
480 // The connection disconnects and unregisters as an observer upon destruction. | 481 // The connection disconnects and unregisters as an observer upon destruction. |
481 EXPECT_CALL(*socket_, Disconnect(_)); | 482 EXPECT_CALL(*socket_, Disconnect(_)); |
482 EXPECT_CALL(*adapter_, RemoveObserver(&connection)); | 483 EXPECT_CALL(*adapter_, RemoveObserver(&connection)); |
483 } | 484 } |
484 | 485 |
485 } // namespace proximity_auth | 486 } // namespace proximity_auth |
OLD | NEW |