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 604213002: [Clean-up] Run git cl format over the proximity_auth component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 "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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 TEST(ProximityAuthConnectionTest, 190 TEST(ProximityAuthConnectionTest,
191 OnBytesReceived_NotifiesObserversOnValidMessage) { 191 OnBytesReceived_NotifiesObserversOnValidMessage) {
192 NiceMock<MockConnection> connection; 192 NiceMock<MockConnection> connection;
193 connection.SetStatus(Connection::CONNECTED); 193 connection.SetStatus(Connection::CONNECTED);
194 194
195 StrictMock<MockConnectionObserver> observer; 195 StrictMock<MockConnectionObserver> observer;
196 connection.AddObserver(&observer); 196 connection.AddObserver(&observer);
197 197
198 ON_CALL(connection, DeserializeWireMessageProxy(_)) 198 ON_CALL(connection, DeserializeWireMessageProxy(_))
199 .WillByDefault(DoAll(SetArgPointee<0>(false), 199 .WillByDefault(
200 Return(new TestWireMessage))); 200 DoAll(SetArgPointee<0>(false), Return(new TestWireMessage)));
201 EXPECT_CALL(observer, OnMessageReceived(Ref(connection), _)); 201 EXPECT_CALL(observer, OnMessageReceived(Ref(connection), _));
202 connection.OnBytesReceived(std::string()); 202 connection.OnBytesReceived(std::string());
203 } 203 }
204 204
205 TEST(ProximityAuthConnectionTest, 205 TEST(ProximityAuthConnectionTest,
206 OnBytesReceived_DoesntNotifyObserversIfNotConnected) { 206 OnBytesReceived_DoesntNotifyObserversIfNotConnected) {
207 StrictMock<MockConnection> connection; 207 StrictMock<MockConnection> connection;
208 connection.SetStatus(Connection::IN_PROGRESS); 208 connection.SetStatus(Connection::IN_PROGRESS);
209 209
210 StrictMock<MockConnectionObserver> observer; 210 StrictMock<MockConnectionObserver> observer;
(...skipping 27 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « components/proximity_auth/bluetooth_util_chromeos.cc ('k') | components/proximity_auth/proximity_auth_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698