OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
6 #error "This file requires ARC support." | |
7 #endif | |
8 | |
9 #import "remoting/ios/bridge/host_proxy.h" | |
10 | |
11 #import "base/compiler_specific.h" | |
12 #import "testing/gtest_mac.h" | |
13 | |
14 namespace remoting { | |
15 | |
16 class HostProxyTest : public ::testing::Test { | |
17 protected: | |
18 virtual void SetUp() OVERRIDE { hostProxy_ = [[HostProxy alloc] init]; } | |
19 | |
20 void CallPassThroughFunctions() { | |
21 [hostProxy_ mouseAction:webrtc::DesktopVector(0, 0) | |
22 wheelDelta:webrtc::DesktopVector(0, 0) | |
23 whichButton:0 | |
24 buttonDown:NO]; | |
25 [hostProxy_ keyboardAction:0 keyDown:NO]; | |
26 } | |
27 | |
28 HostProxy* hostProxy_; | |
29 }; | |
30 | |
31 TEST_F(HostProxyTest, ConnectDisconnect) { | |
32 CallPassThroughFunctions(); | |
33 | |
34 ASSERT_FALSE([hostProxy_ isConnected]); | |
35 [hostProxy_ connectToHost:@"" | |
36 authToken:@"" | |
37 jabberId:@"" | |
38 hostId:@"" | |
39 publicKey:@"" | |
40 delegate:nil]; | |
41 ASSERT_TRUE([hostProxy_ isConnected]); | |
42 | |
43 CallPassThroughFunctions(); | |
44 | |
45 [hostProxy_ disconnectFromHost]; | |
46 ASSERT_FALSE([hostProxy_ isConnected]); | |
47 | |
48 CallPassThroughFunctions(); | |
49 } | |
50 | |
51 } // namespace remoting | |
OLD | NEW |