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 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 if (cameraDevice != null) { | 136 if (cameraDevice != null) { |
137 cameraDevice.close(); | 137 cameraDevice.close(); |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 looperThread.requestStop(); | 141 looperThread.requestStop(); |
142 ThreadUtils.joinUninterruptibly(looperThread); | 142 ThreadUtils.joinUninterruptibly(looperThread); |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 private class TestObjectFactory | 146 private class TestObjectFactory extends CameraVideoCapturerTestFixtures.TestOb
jectFactory { |
147 extends CameraVideoCapturerTestFixtures.TestObjectFactory { | |
148 @Override | 147 @Override |
149 public CameraEnumerator getCameraEnumerator() { | 148 public CameraEnumerator getCameraEnumerator() { |
150 return new Camera2Enumerator(getAppContext()); | 149 return new Camera2Enumerator(getAppContext()); |
151 } | 150 } |
152 | 151 |
153 @Override | 152 @Override |
154 public Context getAppContext() { | 153 public Context getAppContext() { |
155 return getInstrumentation().getTargetContext(); | 154 return getInstrumentation().getTargetContext(); |
156 } | 155 } |
157 | 156 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 fixtures.startWhileCameraIsAlreadyOpenAndCloseCamera(); | 289 fixtures.startWhileCameraIsAlreadyOpenAndCloseCamera(); |
291 } | 290 } |
292 | 291 |
293 // This test that CameraVideoCapturer.stop can be called while CameraVideoCapt
urer is | 292 // This test that CameraVideoCapturer.stop can be called while CameraVideoCapt
urer is |
294 // re-trying to start. | 293 // re-trying to start. |
295 @MediumTest | 294 @MediumTest |
296 public void testStartWhileCameraIsAlreadyOpenAndStop() throws InterruptedExcep
tion { | 295 public void testStartWhileCameraIsAlreadyOpenAndStop() throws InterruptedExcep
tion { |
297 fixtures.startWhileCameraIsAlreadyOpenAndStop(); | 296 fixtures.startWhileCameraIsAlreadyOpenAndStop(); |
298 } | 297 } |
299 } | 298 } |
OLD | NEW |