• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright 2018 The WebRTC project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 package org.webrtc;
12 
13 import static com.google.common.truth.Truth.assertThat;
14 
15 import androidx.test.filters.SmallTest;
16 import org.junit.Before;
17 import org.junit.Test;
18 
19 public final class BuiltinAudioCodecsFactoryFactoryTest {
20   @Before
setUp()21   public void setUp() {
22     System.loadLibrary(TestConstants.NATIVE_LIBRARY);
23   }
24 
25   @Test
26   @SmallTest
testAudioEncoderFactoryFactoryTest()27   public void testAudioEncoderFactoryFactoryTest() throws Exception {
28     BuiltinAudioEncoderFactoryFactory factory = new BuiltinAudioEncoderFactoryFactory();
29     long aef = 0;
30     try {
31       aef = factory.createNativeAudioEncoderFactory();
32       assertThat(aef).isNotEqualTo(0);
33     } finally {
34       if (aef != 0) {
35         JniCommon.nativeReleaseRef(aef);
36       }
37     }
38   }
39 
40   @Test
41   @SmallTest
testAudioDecoderFactoryFactoryTest()42   public void testAudioDecoderFactoryFactoryTest() throws Exception {
43     BuiltinAudioDecoderFactoryFactory factory = new BuiltinAudioDecoderFactoryFactory();
44     long adf = 0;
45     try {
46       adf = factory.createNativeAudioDecoderFactory();
47       assertThat(adf).isNotEqualTo(0);
48     } finally {
49       if (adf != 0) {
50         JniCommon.nativeReleaseRef(adf);
51       }
52     }
53   }
54 }
55