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

Side by Side Diff: webrtc/examples/androidtests/src/org/appspot/apprtc/test/LooperExecutorTest.java

Issue 1876233002: Add test annotations to AppRTCDemoTest. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | webrtc/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java » ('j') | 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 2015 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2015 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.test; 11 package org.appspot.apprtc.test;
12 12
13 import java.util.concurrent.CountDownLatch; 13 import java.util.concurrent.CountDownLatch;
14 import java.util.concurrent.TimeUnit; 14 import java.util.concurrent.TimeUnit;
15 15
16 import org.appspot.apprtc.util.LooperExecutor; 16 import org.appspot.apprtc.util.LooperExecutor;
17 17
18 import android.test.InstrumentationTestCase; 18 import android.test.InstrumentationTestCase;
19 import android.test.suitebuilder.annotation.SmallTest;
19 import android.util.Log; 20 import android.util.Log;
20 21
21 public class LooperExecutorTest extends InstrumentationTestCase { 22 public class LooperExecutorTest extends InstrumentationTestCase {
22 private static final String TAG = "LooperTest"; 23 private static final String TAG = "LooperTest";
23 private static final int WAIT_TIMEOUT = 5000; 24 private static final int WAIT_TIMEOUT = 5000;
24 25
26 @SmallTest
25 public void testLooperExecutor() throws InterruptedException { 27 public void testLooperExecutor() throws InterruptedException {
26 Log.d(TAG, "testLooperExecutor"); 28 Log.d(TAG, "testLooperExecutor");
27 final int counter[] = new int[1]; 29 final int counter[] = new int[1];
28 final int expectedCounter = 10; 30 final int expectedCounter = 10;
29 final CountDownLatch looperDone = new CountDownLatch(1); 31 final CountDownLatch looperDone = new CountDownLatch(1);
30 32
31 Runnable counterIncRunnable = new Runnable() { 33 Runnable counterIncRunnable = new Runnable() {
32 @Override 34 @Override
33 public void run() { 35 public void run() {
34 counter[0]++; 36 counter[0]++;
(...skipping 23 matching lines...) Expand all
58 60
59 // Wait for final looper task and make sure the counter increment task 61 // Wait for final looper task and make sure the counter increment task
60 // is executed expected amount of times. 62 // is executed expected amount of times.
61 looperDone.await(WAIT_TIMEOUT, TimeUnit.MILLISECONDS); 63 looperDone.await(WAIT_TIMEOUT, TimeUnit.MILLISECONDS);
62 assertTrue (looperDone.getCount() == 0); 64 assertTrue (looperDone.getCount() == 0);
63 assertTrue (counter[0] == expectedCounter); 65 assertTrue (counter[0] == expectedCounter);
64 66
65 Log.d(TAG, "testLooperExecutor done"); 67 Log.d(TAG, "testLooperExecutor done");
66 } 68 }
67 } 69 }
OLDNEW
« no previous file with comments | « no previous file | webrtc/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698