| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2014 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 static org.junit.Assert.assertTrue; | 13 import static org.junit.Assert.assertTrue; |
| 14 import static org.junit.Assert.fail; | 14 import static org.junit.Assert.fail; |
| 15 | 15 |
| 16 import android.os.Build; | 16 import android.os.Build; |
| 17 import android.support.test.InstrumentationRegistry; | 17 import android.support.test.InstrumentationRegistry; |
| 18 import android.support.test.filters.FlakyTest; | |
| 19 import android.support.test.filters.SmallTest; | 18 import android.support.test.filters.SmallTest; |
| 20 import android.util.Log; | 19 import android.util.Log; |
| 21 import java.util.LinkedList; | 20 import java.util.LinkedList; |
| 22 import java.util.List; | 21 import java.util.List; |
| 23 import java.util.concurrent.CountDownLatch; | 22 import java.util.concurrent.CountDownLatch; |
| 24 import java.util.concurrent.ExecutorService; | 23 import java.util.concurrent.ExecutorService; |
| 25 import java.util.concurrent.Executors; | 24 import java.util.concurrent.Executors; |
| 26 import java.util.concurrent.TimeUnit; | 25 import java.util.concurrent.TimeUnit; |
| 27 import org.appspot.apprtc.AppRTCClient.SignalingParameters; | 26 import org.appspot.apprtc.AppRTCClient.SignalingParameters; |
| 28 import org.appspot.apprtc.PeerConnectionClient; | 27 import org.appspot.apprtc.PeerConnectionClient; |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 assertTrue("Remote video frames were not rendered after camera switch.", | 585 assertTrue("Remote video frames were not rendered after camera switch.", |
| 587 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 586 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
| 588 } | 587 } |
| 589 pcClient.close(); | 588 pcClient.close(); |
| 590 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); | 589 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); |
| 591 Log.d(TAG, "testCameraSwitch done."); | 590 Log.d(TAG, "testCameraSwitch done."); |
| 592 } | 591 } |
| 593 | 592 |
| 594 // Checks if video source can be restarted - simulate app goes to | 593 // Checks if video source can be restarted - simulate app goes to |
| 595 // background and back to foreground. | 594 // background and back to foreground. |
| 596 // Disabled because of https://bugs.chromium.org/p/webrtc/issues/detail?id=647
8 | |
| 597 @Test | 595 @Test |
| 598 @FlakyTest | 596 @SmallTest |
| 599 //@SmallTest | |
| 600 public void testVideoSourceRestart() throws InterruptedException { | 597 public void testVideoSourceRestart() throws InterruptedException { |
| 601 Log.d(TAG, "testVideoSourceRestart"); | 598 Log.d(TAG, "testVideoSourceRestart"); |
| 602 loopback = true; | 599 loopback = true; |
| 603 | 600 |
| 604 MockRenderer localRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, LOCAL_R
ENDERER_NAME); | 601 MockRenderer localRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, LOCAL_R
ENDERER_NAME); |
| 605 MockRenderer remoteRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, REMOTE
_RENDERER_NAME); | 602 MockRenderer remoteRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, REMOTE
_RENDERER_NAME); |
| 606 | 603 |
| 607 pcClient = createPeerConnectionClient(localRenderer, remoteRenderer, | 604 pcClient = createPeerConnectionClient(localRenderer, remoteRenderer, |
| 608 createParametersForVideoCall(VIDEO_CODEC_VP8), | 605 createParametersForVideoCall(VIDEO_CODEC_VP8), |
| 609 createCameraCapturer(false /* captureToTexture */), null); | 606 createCameraCapturer(false /* captureToTexture */), null); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 637 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 634 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
| 638 assertTrue("Remote video frames were not rendered after video restart.", | 635 assertTrue("Remote video frames were not rendered after video restart.", |
| 639 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 636 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
| 640 } | 637 } |
| 641 pcClient.close(); | 638 pcClient.close(); |
| 642 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); | 639 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); |
| 643 Log.d(TAG, "testVideoSourceRestart done."); | 640 Log.d(TAG, "testVideoSourceRestart done."); |
| 644 } | 641 } |
| 645 | 642 |
| 646 // Checks if capture format can be changed on fly and decoder can be reset pro
perly. | 643 // Checks if capture format can be changed on fly and decoder can be reset pro
perly. |
| 647 // Disabled because of https://bugs.chromium.org/p/webrtc/issues/detail?id=647
8 | |
| 648 @Test | 644 @Test |
| 649 @FlakyTest | 645 @SmallTest |
| 650 //@SmallTest | |
| 651 public void testCaptureFormatChange() throws InterruptedException { | 646 public void testCaptureFormatChange() throws InterruptedException { |
| 652 Log.d(TAG, "testCaptureFormatChange"); | 647 Log.d(TAG, "testCaptureFormatChange"); |
| 653 loopback = true; | 648 loopback = true; |
| 654 | 649 |
| 655 MockRenderer localRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, LOCAL_R
ENDERER_NAME); | 650 MockRenderer localRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, LOCAL_R
ENDERER_NAME); |
| 656 MockRenderer remoteRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, REMOTE
_RENDERER_NAME); | 651 MockRenderer remoteRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, REMOTE
_RENDERER_NAME); |
| 657 | 652 |
| 658 pcClient = createPeerConnectionClient(localRenderer, remoteRenderer, | 653 pcClient = createPeerConnectionClient(localRenderer, remoteRenderer, |
| 659 createParametersForVideoCall(VIDEO_CODEC_VP8), | 654 createParametersForVideoCall(VIDEO_CODEC_VP8), |
| 660 createCameraCapturer(false /* captureToTexture */), null); | 655 createCameraCapturer(false /* captureToTexture */), null); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 690 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 685 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
| 691 assertTrue("Remote video frames were not rendered after capture format cha
nge.", | 686 assertTrue("Remote video frames were not rendered after capture format cha
nge.", |
| 692 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 687 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
| 693 } | 688 } |
| 694 | 689 |
| 695 pcClient.close(); | 690 pcClient.close(); |
| 696 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); | 691 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); |
| 697 Log.d(TAG, "testCaptureFormatChange done."); | 692 Log.d(TAG, "testCaptureFormatChange done."); |
| 698 } | 693 } |
| 699 } | 694 } |
| OLD | NEW |