| 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.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.base.test.util.DisabledTest; |
| 18 import org.chromium.testing.local.LocalRobolectricTestRunner; | 19 import org.chromium.testing.local.LocalRobolectricTestRunner; |
| 19 import org.junit.After; | 20 import org.junit.After; |
| 20 import org.junit.Before; | 21 import org.junit.Before; |
| 21 import org.junit.Test; | 22 import org.junit.Test; |
| 22 import org.junit.runner.RunWith; | 23 import org.junit.runner.RunWith; |
| 23 import org.mockito.Mock; | 24 import org.mockito.Mock; |
| 24 import org.mockito.MockitoAnnotations; | 25 import org.mockito.MockitoAnnotations; |
| 25 import org.robolectric.annotation.Config; | 26 import org.robolectric.annotation.Config; |
| 26 import org.robolectric.shadows.ShadowLog; | 27 import org.robolectric.shadows.ShadowLog; |
| 27 | 28 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 Thread.sleep(SERVER_WAIT); | 90 Thread.sleep(SERVER_WAIT); |
| 90 } catch (InterruptedException e) { | 91 } catch (InterruptedException e) { |
| 91 fail(e.getMessage()); | 92 fail(e.getMessage()); |
| 92 } | 93 } |
| 93 setUpIPv4Client(); | 94 setUpIPv4Client(); |
| 94 | 95 |
| 95 verify(serverEvents, timeout(CONNECT_TIMEOUT)).onTCPConnected(true); | 96 verify(serverEvents, timeout(CONNECT_TIMEOUT)).onTCPConnected(true); |
| 96 verify(clientEvents, timeout(CONNECT_TIMEOUT)).onTCPConnected(false); | 97 verify(clientEvents, timeout(CONNECT_TIMEOUT)).onTCPConnected(false); |
| 97 } | 98 } |
| 98 | 99 |
| 99 @Test | 100 // @Test |
| 101 // Disabled because it fails when IPv6 is not supported on the bot. |
| 102 // TODO(ehmaldonado): Enable when bugs.webrtc.org/6437 is fixed. |
| 103 @DisabledTest |
| 100 public void testConnectIPv6() { | 104 public void testConnectIPv6() { |
| 101 setUpIPv6Server(); | 105 setUpIPv6Server(); |
| 102 try { | 106 try { |
| 103 Thread.sleep(SERVER_WAIT); | 107 Thread.sleep(SERVER_WAIT); |
| 104 } catch (InterruptedException e) { | 108 } catch (InterruptedException e) { |
| 105 fail(e.getMessage()); | 109 fail(e.getMessage()); |
| 106 } | 110 } |
| 107 setUpIPv6Client(); | 111 setUpIPv6Client(); |
| 108 | 112 |
| 109 verify(serverEvents, timeout(CONNECT_TIMEOUT)).onTCPConnected(true); | 113 verify(serverEvents, timeout(CONNECT_TIMEOUT)).onTCPConnected(true); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 * Queues runnable to be run and waits for it to be executed by the executor t
hread | 194 * Queues runnable to be run and waits for it to be executed by the executor t
hread |
| 191 */ | 195 */ |
| 192 public void executeAndWait(Runnable runnable) { | 196 public void executeAndWait(Runnable runnable) { |
| 193 try { | 197 try { |
| 194 executor.submit(runnable).get(); | 198 executor.submit(runnable).get(); |
| 195 } catch (Exception e) { | 199 } catch (Exception e) { |
| 196 fail(e.getMessage()); | 200 fail(e.getMessage()); |
| 197 } | 201 } |
| 198 } | 202 } |
| 199 } | 203 } |
| OLD | NEW |