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

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

Issue 2825313002: Espresso test for loopback video quality testing (Closed)
Patch Set: Rework colliderUrl as urlParameters Created 3 years, 7 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
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
(...skipping 20 matching lines...) Expand all
31 import org.junit.Rule; 31 import org.junit.Rule;
32 import org.junit.Test; 32 import org.junit.Test;
33 import org.junit.runner.RunWith; 33 import org.junit.runner.RunWith;
34 34
35 /** 35 /**
36 * Used to start a loopback call with video input from file and video output als o to file. 36 * Used to start a loopback call with video input from file and video output als o to file.
37 * The test case is a building block in other testing for video quality. 37 * The test case is a building block in other testing for video quality.
38 */ 38 */
39 @RunWith(AndroidJUnit4.class) 39 @RunWith(AndroidJUnit4.class)
40 @LargeTest 40 @LargeTest
41 public class ConnectActivityStubbedInputOutputTest { 41 public class CallActivityStubbedInputOutputTest {
42 private static final String TAG = "ConnectActivityStubbedInputOutputTest"; 42 private static final String TAG = "CallActivityStubbedInputOutputTest";
43 43
44 @Rule 44 @Rule
45 public ActivityTestRule<ConnectActivity> rule = 45 public ActivityTestRule<CallActivity> rule = new ActivityTestRule<CallActivity >(
46 new ActivityTestRule<ConnectActivity>(ConnectActivity.class) { 46 CallActivity.class) {
47 @Override 47 @Override
48 protected Intent getActivityIntent() { 48 protected Intent getActivityIntent() {
49 Context context = InstrumentationRegistry.getInstrumentation().getTarg etContext(); 49 Context context = InstrumentationRegistry.getContext();
50 Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("ht tps://appr.tc"), 50 Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("http:/ /localhost:9999"));
51 context, ConnectActivity.class);
52 51
53 intent.putExtra(CallActivity.EXTRA_USE_VALUES_FROM_INTENT, true); 52 intent.putExtra(CallActivity.EXTRA_USE_VALUES_FROM_INTENT, true);
54 53
55 intent.putExtra(CallActivity.EXTRA_LOOPBACK, true); 54 intent.putExtra(CallActivity.EXTRA_LOOPBACK, true);
56 intent.putExtra(CallActivity.EXTRA_AUDIOCODEC, "OPUS"); 55 intent.putExtra(CallActivity.EXTRA_AUDIOCODEC, "OPUS");
57 intent.putExtra(CallActivity.EXTRA_VIDEOCODEC, "VP8"); 56 intent.putExtra(CallActivity.EXTRA_VIDEOCODEC, "VP8");
58 intent.putExtra(CallActivity.EXTRA_CAPTURETOTEXTURE_ENABLED, false); 57 intent.putExtra(CallActivity.EXTRA_CAPTURETOTEXTURE_ENABLED, false);
59 intent.putExtra(CallActivity.EXTRA_CAMERA2, false); 58 intent.putExtra(CallActivity.EXTRA_CAMERA2, false);
60 intent.putExtra(CallActivity.EXTRA_ROOMID, UUID.randomUUID().toString( ).substring(0, 8)); 59 intent.putExtra(CallActivity.EXTRA_ROOMID, UUID.randomUUID().toString().su bstring(0, 8));
60 // TODO false for wstls to disable https, should be option later or if URL is http
61 intent.putExtra(CallActivity.EXTRA_URLPARAMETERS,
62 "wstls=false?debug=loopback?ts=?wshpp=http://localhost:8089");
61 63
62 intent.putExtra(CallActivity.EXTRA_VIDEO_FILE_AS_CAMERA, 64 intent.putExtra(CallActivity.EXTRA_VIDEO_FILE_AS_CAMERA,
63 Environment.getExternalStorageDirectory().getAbsolutePath() 65 Environment.getExternalStorageDirectory().getAbsolutePath()
64 + "/chromium_tests_root/resources/reference_video_640x360_30fp s.y4m"); 66 + "/chromium_tests_root/resources/reference_video_640x360_30fps.y4 m");
65 67
66 intent.putExtra(CallActivity.EXTRA_SAVE_REMOTE_VIDEO_TO_FILE, 68 intent.putExtra(CallActivity.EXTRA_SAVE_REMOTE_VIDEO_TO_FILE,
67 Environment.getExternalStorageDirectory().getAbsolutePath() + "/ou tput.y4m"); 69 Environment.getExternalStorageDirectory().getAbsolutePath() + "/output .y4m");
68 intent.putExtra(CallActivity.EXTRA_SAVE_REMOTE_VIDEO_TO_FILE_WIDTH, 64 0); 70 intent.putExtra(CallActivity.EXTRA_SAVE_REMOTE_VIDEO_TO_FILE_WIDTH, 640);
69 intent.putExtra(CallActivity.EXTRA_SAVE_REMOTE_VIDEO_TO_FILE_HEIGHT, 3 60); 71 intent.putExtra(CallActivity.EXTRA_SAVE_REMOTE_VIDEO_TO_FILE_HEIGHT, 360);
70 72
71 return intent; 73 return intent;
72 } 74 }
73 }; 75 };
74 76
75 @Test 77 @Test
76 public void testLoopback() throws InterruptedException { 78 public void testLoopback() throws InterruptedException {
77 // The time to write down the data during closing of the program can take a while. 79 // The time to write down the data during closing of the program can take a while.
78 IdlingPolicies.setMasterPolicyTimeout(240000, TimeUnit.MILLISECONDS); 80 IdlingPolicies.setMasterPolicyTimeout(240000, TimeUnit.MILLISECONDS);
79 81
80 // During the time we sleep it will record video. 82 // During the time we sleep it will record video.
81 Thread.sleep(10000); 83 Thread.sleep(8000);
82 84
83 // Click on hang-up button. 85 // Click on hang-up button.
84 onView(withId(R.id.button_call_disconnect)).perform(click()); 86 onView(withId(R.id.button_call_disconnect)).perform(click());
85 } 87 }
86 } 88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698