OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 * behaviour. | 34 * behaviour. |
35 */ | 35 */ |
36 @RunWith(LocalRobolectricTestRunner.class) | 36 @RunWith(LocalRobolectricTestRunner.class) |
37 @Config(manifest = Config.NONE) | 37 @Config(manifest = Config.NONE) |
38 public class DirectRTCClientTest { | 38 public class DirectRTCClientTest { |
39 private static final String ROOM_URL = ""; | 39 private static final String ROOM_URL = ""; |
40 private static final boolean LOOPBACK = false; | 40 private static final boolean LOOPBACK = false; |
41 | 41 |
42 private static final String DUMMY_SDP_MID = "sdpMid"; | 42 private static final String DUMMY_SDP_MID = "sdpMid"; |
43 private static final String DUMMY_SDP = "sdp"; | 43 private static final String DUMMY_SDP = "sdp"; |
44 private static final String DUMMY_SERVER_URL = "serverUrl"; | |
45 | 44 |
46 public static final int SERVER_WAIT = 100; | 45 public static final int SERVER_WAIT = 100; |
47 public static final int NETWORK_TIMEOUT = 1000; | 46 public static final int NETWORK_TIMEOUT = 1000; |
48 | 47 |
49 private DirectRTCClient client; | 48 private DirectRTCClient client; |
50 private DirectRTCClient server; | 49 private DirectRTCClient server; |
51 | 50 |
52 AppRTCClient.SignalingEvents clientEvents; | 51 AppRTCClient.SignalingEvents clientEvents; |
53 AppRTCClient.SignalingEvents serverEvents; | 52 AppRTCClient.SignalingEvents serverEvents; |
54 | 53 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 server.sendOfferSdp(offerSdp); | 129 server.sendOfferSdp(offerSdp); |
131 verify(clientEvents, timeout(NETWORK_TIMEOUT)) | 130 verify(clientEvents, timeout(NETWORK_TIMEOUT)) |
132 .onConnectedToRoom(any(AppRTCClient.SignalingParameters.class)); | 131 .onConnectedToRoom(any(AppRTCClient.SignalingParameters.class)); |
133 | 132 |
134 SessionDescription answerSdp = | 133 SessionDescription answerSdp = |
135 new SessionDescription(SessionDescription.Type.ANSWER, DUMMY_SDP); | 134 new SessionDescription(SessionDescription.Type.ANSWER, DUMMY_SDP); |
136 client.sendAnswerSdp(answerSdp); | 135 client.sendAnswerSdp(answerSdp); |
137 verify(serverEvents, timeout(NETWORK_TIMEOUT)) | 136 verify(serverEvents, timeout(NETWORK_TIMEOUT)) |
138 .onRemoteDescription(isNotNull(SessionDescription.class)); | 137 .onRemoteDescription(isNotNull(SessionDescription.class)); |
139 | 138 |
140 IceCandidate candidate = new IceCandidate(DUMMY_SDP_MID, 0, DUMMY_SDP, DUMMY
_SERVER_URL); | 139 IceCandidate candidate = new IceCandidate(DUMMY_SDP_MID, 0, DUMMY_SDP); |
141 server.sendLocalIceCandidate(candidate); | 140 server.sendLocalIceCandidate(candidate); |
142 verify(clientEvents, timeout(NETWORK_TIMEOUT)) | 141 verify(clientEvents, timeout(NETWORK_TIMEOUT)) |
143 .onRemoteIceCandidate(isNotNull(IceCandidate.class)); | 142 .onRemoteIceCandidate(isNotNull(IceCandidate.class)); |
144 | 143 |
145 client.sendLocalIceCandidate(candidate); | 144 client.sendLocalIceCandidate(candidate); |
146 verify(serverEvents, timeout(NETWORK_TIMEOUT)) | 145 verify(serverEvents, timeout(NETWORK_TIMEOUT)) |
147 .onRemoteIceCandidate(isNotNull(IceCandidate.class)); | 146 .onRemoteIceCandidate(isNotNull(IceCandidate.class)); |
148 | 147 |
149 client.disconnectFromRoom(); | 148 client.disconnectFromRoom(); |
150 verify(clientEvents, timeout(NETWORK_TIMEOUT)).onChannelClose(); | 149 verify(clientEvents, timeout(NETWORK_TIMEOUT)).onChannelClose(); |
151 verify(serverEvents, timeout(NETWORK_TIMEOUT)).onChannelClose(); | 150 verify(serverEvents, timeout(NETWORK_TIMEOUT)).onChannelClose(); |
152 | 151 |
153 verifyNoMoreInteractions(clientEvents); | 152 verifyNoMoreInteractions(clientEvents); |
154 verifyNoMoreInteractions(serverEvents); | 153 verifyNoMoreInteractions(serverEvents); |
155 } | 154 } |
156 } | 155 } |
OLD | NEW |