| 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/connection.h" | 5 #include "components/proximity_auth/connection.h" |
| 6 | 6 |
| 7 #include "components/proximity_auth/connection_observer.h" | 7 #include "components/proximity_auth/connection_observer.h" |
| 8 #include "components/proximity_auth/remote_device.h" | 8 #include "components/proximity_auth/remote_device.h" |
| 9 #include "components/proximity_auth/wire_message.h" | 9 #include "components/proximity_auth/wire_message.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 bool success)); | 70 bool success)); |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 DISALLOW_COPY_AND_ASSIGN(MockConnectionObserver); | 73 DISALLOW_COPY_AND_ASSIGN(MockConnectionObserver); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 // Unlike WireMessage, offers a public constructor. | 76 // Unlike WireMessage, offers a public constructor. |
| 77 class TestWireMessage : public WireMessage { | 77 class TestWireMessage : public WireMessage { |
| 78 public: | 78 public: |
| 79 TestWireMessage() : WireMessage(std::string(), std::string()) {} | 79 TestWireMessage() : WireMessage(std::string(), std::string()) {} |
| 80 virtual ~TestWireMessage() {} | 80 ~TestWireMessage() override {} |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 DISALLOW_COPY_AND_ASSIGN(TestWireMessage); | 83 DISALLOW_COPY_AND_ASSIGN(TestWireMessage); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace | 86 } // namespace |
| 87 | 87 |
| 88 TEST(ProximityAuthConnectionTest, IsConnected) { | 88 TEST(ProximityAuthConnectionTest, IsConnected) { |
| 89 StrictMock<MockConnection> connection; | 89 StrictMock<MockConnection> connection; |
| 90 EXPECT_FALSE(connection.IsConnected()); | 90 EXPECT_FALSE(connection.IsConnected()); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 connection.AddObserver(&observer); | 238 connection.AddObserver(&observer); |
| 239 | 239 |
| 240 ON_CALL(connection, DeserializeWireMessageProxy(_)) | 240 ON_CALL(connection, DeserializeWireMessageProxy(_)) |
| 241 .WillByDefault(DoAll(SetArgPointee<0>(false), | 241 .WillByDefault(DoAll(SetArgPointee<0>(false), |
| 242 Return(static_cast<WireMessage*>(NULL)))); | 242 Return(static_cast<WireMessage*>(NULL)))); |
| 243 EXPECT_CALL(observer, OnMessageReceived(_, _)).Times(0); | 243 EXPECT_CALL(observer, OnMessageReceived(_, _)).Times(0); |
| 244 connection.OnBytesReceived(std::string()); | 244 connection.OnBytesReceived(std::string()); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace proximity_auth | 247 } // namespace proximity_auth |
| OLD | NEW |