Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: components/proximity_auth/connection_unittest.cc

Issue 2560713002: Move RemoteDevice from //components/proximity_auth to //components/cryptauth so that it can be easi… (Closed)
Patch Set: Add cryptauth dependency. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "components/cryptauth/remote_device.h"
9 #include "components/proximity_auth/connection_observer.h" 10 #include "components/proximity_auth/connection_observer.h"
10 #include "components/proximity_auth/remote_device.h"
11 #include "components/proximity_auth/wire_message.h" 11 #include "components/proximity_auth/wire_message.h"
12 #include "testing/gmock/include/gmock/gmock.h" 12 #include "testing/gmock/include/gmock/gmock.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 using testing::_; 15 using testing::_;
16 using testing::DoAll; 16 using testing::DoAll;
17 using testing::NiceMock; 17 using testing::NiceMock;
18 using testing::Return; 18 using testing::Return;
19 using testing::SetArgPointee; 19 using testing::SetArgPointee;
20 using testing::StrictMock; 20 using testing::StrictMock;
21 21
22 namespace proximity_auth { 22 namespace proximity_auth {
23 namespace { 23 namespace {
24 24
25 class MockConnection : public Connection { 25 class MockConnection : public Connection {
26 public: 26 public:
27 MockConnection() : Connection(RemoteDevice()) {} 27 MockConnection() : Connection(cryptauth::RemoteDevice()) {}
28 ~MockConnection() {} 28 ~MockConnection() {}
29 29
30 MOCK_METHOD1(SetPaused, void(bool paused)); 30 MOCK_METHOD1(SetPaused, void(bool paused));
31 MOCK_METHOD0(Connect, void()); 31 MOCK_METHOD0(Connect, void());
32 MOCK_METHOD0(Disconnect, void()); 32 MOCK_METHOD0(Disconnect, void());
33 MOCK_METHOD0(CancelConnectionAttempt, void()); 33 MOCK_METHOD0(CancelConnectionAttempt, void());
34 MOCK_METHOD1(SendMessageImplProxy, void(WireMessage* message)); 34 MOCK_METHOD1(SendMessageImplProxy, void(WireMessage* message));
35 MOCK_METHOD1(DeserializeWireMessageProxy, 35 MOCK_METHOD1(DeserializeWireMessageProxy,
36 WireMessage*(bool* is_incomplete_message)); 36 WireMessage*(bool* is_incomplete_message));
37 37
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 StrictMock<MockConnectionObserver> observer; 237 StrictMock<MockConnectionObserver> observer;
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), Return(nullptr))); 241 .WillByDefault(DoAll(SetArgPointee<0>(false), Return(nullptr)));
242 EXPECT_CALL(observer, OnMessageReceived(_, _)).Times(0); 242 EXPECT_CALL(observer, OnMessageReceived(_, _)).Times(0);
243 connection.OnBytesReceived(std::string()); 243 connection.OnBytesReceived(std::string());
244 } 244 }
245 245
246 } // namespace proximity_auth 246 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « components/proximity_auth/connection.cc ('k') | components/proximity_auth/device_to_device_authenticator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698