1 /* 2 * Copyright (C) 2022 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.app.sdksandbox.testutils.testscenario; 18 19 import java.util.List; 20 import android.os.Bundle; 21 22 import android.app.sdksandbox.testutils.testscenario.ISdkSandboxResultCallback; 23 24 interface ISdkSandboxTestExecutor { 25 26 /* 27 * This constant is used for optionally passing setup parameters 28 * to the test sdk. This is useful for when a test author needs to 29 * pass specific information to setup the sdk. 30 * E.g. The test instance class 31 */ 32 const String TEST_SETUP_PARAMS = "TEST_SETUP_PARAMS"; 33 34 /* 35 * This constant is used for optionally loading a test author 36 * binder. This is useful for when a test author wants their 37 * SDK driven tests to invoke an event outside the test SDK. 38 */ 39 const String TEST_AUTHOR_DEFINED_BINDER = "TEST_AUTHOR_DEFINED_BINDER"; 40 41 /** 42 * Returns a list of method names that had an annotation 43 * name. 44 */ retrieveAnnotatedMethods(String canonicalAnnotation)45 List<String> retrieveAnnotatedMethods(String canonicalAnnotation); 46 47 /** 48 * Invokes a method from within the SDK. 49 50 */ invokeMethod(String methodName, in Bundle params, in ISdkSandboxResultCallback callback)51 void invokeMethod(String methodName, in Bundle params, 52 in ISdkSandboxResultCallback callback); 53 54 /** 55 * Executed after each test finishes in assertSdkTestRunPasses. 56 */ cleanOnTestFinish()57 void cleanOnTestFinish(); 58 } 59