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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 using BluetoothConnection::DeviceRemoved; | 73 using BluetoothConnection::DeviceRemoved; |
74 using BluetoothConnection::Disconnect; | 74 using BluetoothConnection::Disconnect; |
75 | 75 |
76 private: | 76 private: |
77 DISALLOW_COPY_AND_ASSIGN(MockBluetoothConnection); | 77 DISALLOW_COPY_AND_ASSIGN(MockBluetoothConnection); |
78 }; | 78 }; |
79 | 79 |
80 class TestWireMessage : public WireMessage { | 80 class TestWireMessage : public WireMessage { |
81 public: | 81 public: |
82 TestWireMessage() : WireMessage("permit id", "payload") {} | 82 TestWireMessage() : WireMessage("permit id", "payload") {} |
83 virtual ~TestWireMessage() {} | 83 ~TestWireMessage() override {} |
84 | 84 |
85 virtual std::string Serialize() const override { return kSerializedMessage; } | 85 std::string Serialize() const override { return kSerializedMessage; } |
86 | 86 |
87 private: | 87 private: |
88 DISALLOW_COPY_AND_ASSIGN(TestWireMessage); | 88 DISALLOW_COPY_AND_ASSIGN(TestWireMessage); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace | 91 } // namespace |
92 | 92 |
93 class ProximityAuthBluetoothConnectionTest : public testing::Test { | 93 class ProximityAuthBluetoothConnectionTest : public testing::Test { |
94 public: | 94 public: |
95 ProximityAuthBluetoothConnectionTest() | 95 ProximityAuthBluetoothConnectionTest() |
(...skipping 346 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 |