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 static org.junit.Assert.assertFalse; | 13 import static org.junit.Assert.assertFalse; |
14 import static org.junit.Assert.assertTrue; | 14 import static org.junit.Assert.assertTrue; |
15 import static org.junit.Assert.fail; | 15 import static org.junit.Assert.fail; |
16 import static org.mockito.Matchers.any; | 16 import static org.mockito.Matchers.any; |
17 import static org.mockito.Matchers.isNotNull; | 17 import static org.mockito.Matchers.isNotNull; |
18 import static org.mockito.Mockito.mock; | 18 import static org.mockito.Mockito.mock; |
19 import static org.mockito.Mockito.timeout; | 19 import static org.mockito.Mockito.timeout; |
20 import static org.mockito.Mockito.verify; | 20 import static org.mockito.Mockito.verify; |
21 import static org.mockito.Mockito.verifyNoMoreInteractions; | 21 import static org.mockito.Mockito.verifyNoMoreInteractions; |
22 | 22 |
| 23 import org.chromium.testing.local.LocalRobolectricTestRunner; |
23 import org.junit.Before; | 24 import org.junit.Before; |
24 import org.junit.Test; | 25 import org.junit.Test; |
25 import org.junit.runner.RunWith; | 26 import org.junit.runner.RunWith; |
26 import org.robolectric.RobolectricTestRunner; | |
27 import org.robolectric.annotation.Config; | 27 import org.robolectric.annotation.Config; |
28 import org.webrtc.IceCandidate; | 28 import org.webrtc.IceCandidate; |
29 import org.webrtc.SessionDescription; | 29 import org.webrtc.SessionDescription; |
30 | 30 |
31 /** | 31 /** |
32 * 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 |
33 * behaviour. | 33 * behaviour. |
34 */ | 34 */ |
35 @RunWith(RobolectricTestRunner.class) | 35 @RunWith(LocalRobolectricTestRunner.class) |
36 @Config(manifest = Config.NONE) | 36 @Config(manifest = Config.NONE) |
37 public class DirectRTCClientTest { | 37 public class DirectRTCClientTest { |
38 private static final String ROOM_URL = ""; | 38 private static final String ROOM_URL = ""; |
39 private static final boolean LOOPBACK = false; | 39 private static final boolean LOOPBACK = false; |
40 | 40 |
41 private static final String DUMMY_SDP_MID = "sdpMid"; | 41 private static final String DUMMY_SDP_MID = "sdpMid"; |
42 private static final String DUMMY_SDP = "sdp"; | 42 private static final String DUMMY_SDP = "sdp"; |
43 | 43 |
44 public static final int SERVER_WAIT = 10; | 44 public static final int SERVER_WAIT = 10; |
45 public static final int NETWORK_TIMEOUT = 100; | 45 public static final int NETWORK_TIMEOUT = 100; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 .onRemoteIceCandidate(isNotNull(IceCandidate.class)); | 137 .onRemoteIceCandidate(isNotNull(IceCandidate.class)); |
138 | 138 |
139 client.disconnectFromRoom(); | 139 client.disconnectFromRoom(); |
140 verify(clientEvents, timeout(NETWORK_TIMEOUT)).onChannelClose(); | 140 verify(clientEvents, timeout(NETWORK_TIMEOUT)).onChannelClose(); |
141 verify(serverEvents, timeout(NETWORK_TIMEOUT)).onChannelClose(); | 141 verify(serverEvents, timeout(NETWORK_TIMEOUT)).onChannelClose(); |
142 | 142 |
143 verifyNoMoreInteractions(clientEvents); | 143 verifyNoMoreInteractions(clientEvents); |
144 verifyNoMoreInteractions(serverEvents); | 144 verifyNoMoreInteractions(serverEvents); |
145 } | 145 } |
146 } | 146 } |
OLD | NEW |