1 /* 2 * Copyright 2015 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.hardware.camera2.cts; 18 19 import android.platform.test.annotations.AppModeFull; 20 import android.test.AndroidTestCase; 21 import android.util.Log; 22 23 /** 24 * <p>Basic test for CameraManager class.</p> 25 */ 26 @AppModeFull 27 public class NativeCameraManagerTest extends AndroidTestCase { 28 private static final String TAG = "NativeCameraManagerTest"; 29 private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE); 30 31 /** Load jni on initialization */ 32 static { 33 Log.i("NativeCameraManagerTest", "before loadlibrary"); 34 System.loadLibrary("ctscamera2_jni"); 35 Log.i("NativeCameraManagerTest", "after loadlibrary"); 36 } 37 testCameraManagerGetAndClose()38 public void testCameraManagerGetAndClose() { 39 assertTrue("testCameraManagerGetAndClose fail, see log for details", 40 testCameraManagerGetAndCloseNative()); 41 } 42 testCameraManagerGetCameraIds()43 public void testCameraManagerGetCameraIds() { 44 assertTrue("testCameraManagerGetCameraIds fail, see log for details", 45 testCameraManagerGetCameraIdsNative()); 46 } 47 testCameraManagerAvailabilityCallback()48 public void testCameraManagerAvailabilityCallback() { 49 assertTrue("testCameraManagerAvailabilityCallback fail, see log for details", 50 testCameraManagerAvailabilityCallbackNative()); 51 } 52 testCameraManagerCameraCharacteristics()53 public void testCameraManagerCameraCharacteristics() { 54 assertTrue("testCameraManagerCameraCharacteristics fail, see log for details", 55 testCameraManagerCharacteristicsNative()); 56 } 57 testCameraManagerGetAndCloseNative()58 private static native boolean testCameraManagerGetAndCloseNative(); testCameraManagerGetCameraIdsNative()59 private static native boolean testCameraManagerGetCameraIdsNative(); testCameraManagerAvailabilityCallbackNative()60 private static native boolean testCameraManagerAvailabilityCallbackNative(); testCameraManagerCharacteristicsNative()61 private static native boolean testCameraManagerCharacteristicsNative(); 62 } 63