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/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "components/proximity_auth/remote_device.h" | 10 #include "components/proximity_auth/remote_device.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 public: | 56 public: |
57 MockBluetoothConnection() | 57 MockBluetoothConnection() |
58 : BluetoothConnection(kRemoteDevice, device::BluetoothUUID(kUuid)) {} | 58 : BluetoothConnection(kRemoteDevice, device::BluetoothUUID(kUuid)) {} |
59 | 59 |
60 // Calls back into the parent Connection class. | 60 // Calls back into the parent Connection class. |
61 MOCK_METHOD1(SetStatusProxy, void(Status status)); | 61 MOCK_METHOD1(SetStatusProxy, void(Status status)); |
62 MOCK_METHOD1(OnBytesReceived, void(const std::string& bytes)); | 62 MOCK_METHOD1(OnBytesReceived, void(const std::string& bytes)); |
63 MOCK_METHOD2(OnDidSendMessage, | 63 MOCK_METHOD2(OnDidSendMessage, |
64 void(const WireMessage& message, bool success)); | 64 void(const WireMessage& message, bool success)); |
65 | 65 |
66 virtual void SetStatus(Status status) override { | 66 void SetStatus(Status status) override { |
67 SetStatusProxy(status); | 67 SetStatusProxy(status); |
68 BluetoothConnection::SetStatus(status); | 68 BluetoothConnection::SetStatus(status); |
69 } | 69 } |
70 | 70 |
71 using BluetoothConnection::status; | 71 using BluetoothConnection::status; |
72 using BluetoothConnection::Connect; | 72 using BluetoothConnection::Connect; |
73 using BluetoothConnection::DeviceRemoved; | 73 using BluetoothConnection::DeviceRemoved; |
74 using BluetoothConnection::Disconnect; | 74 using BluetoothConnection::Disconnect; |
75 | 75 |
76 private: | 76 private: |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 | 442 |
443 ASSERT_FALSE(error_callback.is_null()); | 443 ASSERT_FALSE(error_callback.is_null()); |
444 EXPECT_CALL(connection, OnDidSendMessage(Ref(*expected_wire_message), false)); | 444 EXPECT_CALL(connection, OnDidSendMessage(Ref(*expected_wire_message), false)); |
445 EXPECT_CALL(connection, SetStatusProxy(Connection::DISCONNECTED)); | 445 EXPECT_CALL(connection, SetStatusProxy(Connection::DISCONNECTED)); |
446 EXPECT_CALL(*socket_, Disconnect(_)); | 446 EXPECT_CALL(*socket_, Disconnect(_)); |
447 EXPECT_CALL(*adapter_, RemoveObserver(&connection)); | 447 EXPECT_CALL(*adapter_, RemoveObserver(&connection)); |
448 error_callback.Run("The most helpful of error messages"); | 448 error_callback.Run("The most helpful of error messages"); |
449 } | 449 } |
450 | 450 |
451 } // namespace proximity_auth | 451 } // namespace proximity_auth |
OLD | NEW |