Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: webrtc/examples/androidjunit/src/org/appspot/apprtc/TCPChannelClientTest.java

Issue 2342783002: Change AppRTCDemoJUnitTest to use LocalRobolectricTestRunner. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « webrtc/examples/androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.fail; 13 import static org.junit.Assert.fail;
14 import static org.mockito.Mockito.timeout; 14 import static org.mockito.Mockito.timeout;
15 import static org.mockito.Mockito.verify; 15 import static org.mockito.Mockito.verify;
16 import static org.mockito.Mockito.verifyNoMoreInteractions; 16 import static org.mockito.Mockito.verifyNoMoreInteractions;
17 17
18 import org.chromium.testing.local.LocalRobolectricTestRunner;
18 import org.junit.After; 19 import org.junit.After;
19 import org.junit.Before; 20 import org.junit.Before;
20 import org.junit.Test; 21 import org.junit.Test;
21 import org.junit.runner.RunWith; 22 import org.junit.runner.RunWith;
22 import org.mockito.Mock; 23 import org.mockito.Mock;
23 import org.mockito.MockitoAnnotations; 24 import org.mockito.MockitoAnnotations;
24 import org.robolectric.RobolectricTestRunner;
25 import org.robolectric.annotation.Config; 25 import org.robolectric.annotation.Config;
26 import org.robolectric.shadows.ShadowLog; 26 import org.robolectric.shadows.ShadowLog;
27 27
28 import java.util.concurrent.ExecutorService; 28 import java.util.concurrent.ExecutorService;
29 import java.util.concurrent.Executors; 29 import java.util.concurrent.Executors;
30 import java.util.concurrent.TimeUnit; 30 import java.util.concurrent.TimeUnit;
31 31
32 @RunWith(RobolectricTestRunner.class) 32 @RunWith(LocalRobolectricTestRunner.class)
33 @Config(manifest = Config.NONE) 33 @Config(manifest = Config.NONE)
34 public class TCPChannelClientTest { 34 public class TCPChannelClientTest {
35 private static final int PORT = 8888; 35 private static final int PORT = 8888;
36 /** 36 /**
37 * How long we wait before trying to connect to the server. Chosen quite arbit rarily and 37 * How long we wait before trying to connect to the server. Chosen quite arbit rarily and
38 * could be made smaller if need be. 38 * could be made smaller if need be.
39 */ 39 */
40 private static final int SERVER_WAIT = 10; 40 private static final int SERVER_WAIT = 10;
41 private static final int CONNECT_TIMEOUT = 100; 41 private static final int CONNECT_TIMEOUT = 100;
42 private static final int SEND_TIMEOUT = 100; 42 private static final int SEND_TIMEOUT = 100;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 * Queues runnable to be run and waits for it to be executed by the executor t hread 191 * Queues runnable to be run and waits for it to be executed by the executor t hread
192 */ 192 */
193 public void executeAndWait(Runnable runnable) { 193 public void executeAndWait(Runnable runnable) {
194 try { 194 try {
195 executor.submit(runnable).get(); 195 executor.submit(runnable).get();
196 } catch (Exception e) { 196 } catch (Exception e) {
197 fail(e.getMessage()); 197 fail(e.getMessage());
198 } 198 }
199 } 199 }
200 } 200 }
OLDNEW
« no previous file with comments | « webrtc/examples/androidjunit/src/org/appspot/apprtc/DirectRTCClientTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698