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 |
11 package org.appspot.apprtc; | 11 package org.appspot.apprtc; |
12 | 12 |
13 import org.junit.Before; | |
14 import org.junit.Test; | |
15 import org.junit.runner.RunWith; | |
16 import org.robolectric.RobolectricTestRunner; | |
17 import org.robolectric.annotation.Config; | |
18 import org.webrtc.IceCandidate; | |
19 import org.webrtc.SessionDescription; | |
20 | |
21 import java.util.regex.Matcher; | |
22 | |
23 import static org.junit.Assert.assertFalse; | 13 import static org.junit.Assert.assertFalse; |
24 import static org.junit.Assert.assertTrue; | 14 import static org.junit.Assert.assertTrue; |
25 import static org.junit.Assert.fail; | 15 import static org.junit.Assert.fail; |
26 import static org.mockito.Matchers.any; | 16 import static org.mockito.Matchers.any; |
27 import static org.mockito.Matchers.isNotNull; | 17 import static org.mockito.Matchers.isNotNull; |
28 import static org.mockito.Mockito.mock; | 18 import static org.mockito.Mockito.mock; |
29 import static org.mockito.Mockito.timeout; | 19 import static org.mockito.Mockito.timeout; |
30 import static org.mockito.Mockito.verify; | 20 import static org.mockito.Mockito.verify; |
31 import static org.mockito.Mockito.verifyNoMoreInteractions; | 21 import static org.mockito.Mockito.verifyNoMoreInteractions; |
32 | 22 |
| 23 import org.junit.Before; |
| 24 import org.junit.Test; |
| 25 import org.junit.runner.RunWith; |
| 26 import org.robolectric.RobolectricTestRunner; |
| 27 import org.robolectric.annotation.Config; |
| 28 import org.webrtc.IceCandidate; |
| 29 import org.webrtc.SessionDescription; |
| 30 |
33 /** | 31 /** |
34 * Test for DirectRTCClient. Test is very simple and only tests the overall sani
ty of the class | 32 * Test for DirectRTCClient. Test is very simple and only tests the overall sani
ty of the class |
35 * behaviour. | 33 * behaviour. |
36 */ | 34 */ |
37 @RunWith(RobolectricTestRunner.class) | 35 @RunWith(RobolectricTestRunner.class) |
38 @Config(manifest = Config.NONE) | 36 @Config(manifest = Config.NONE) |
39 public class DirectRTCClientTest { | 37 public class DirectRTCClientTest { |
40 private static final String ROOM_URL = ""; | 38 private static final String ROOM_URL = ""; |
41 private static final boolean LOOPBACK = false; | 39 private static final boolean LOOPBACK = false; |
42 | 40 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 .onRemoteIceCandidate(isNotNull(IceCandidate.class)); | 137 .onRemoteIceCandidate(isNotNull(IceCandidate.class)); |
140 | 138 |
141 client.disconnectFromRoom(); | 139 client.disconnectFromRoom(); |
142 verify(clientEvents, timeout(NETWORK_TIMEOUT)).onChannelClose(); | 140 verify(clientEvents, timeout(NETWORK_TIMEOUT)).onChannelClose(); |
143 verify(serverEvents, timeout(NETWORK_TIMEOUT)).onChannelClose(); | 141 verify(serverEvents, timeout(NETWORK_TIMEOUT)).onChannelClose(); |
144 | 142 |
145 verifyNoMoreInteractions(clientEvents); | 143 verifyNoMoreInteractions(clientEvents); |
146 verifyNoMoreInteractions(serverEvents); | 144 verifyNoMoreInteractions(serverEvents); |
147 } | 145 } |
148 } | 146 } |
OLD | NEW |