Makes it possible to robo-test Settings app fragments.
This adds bunch of shadow/placeholder classes and logic to handle references to Android internal resources or newly added classes/methods that Robolectric hasn't yet picked up. Developers can follow ManageApplicationsTest example to use the shadow classes and the utility method to start ther fragment in their robolectric tests. Bug: 33431346 Test: This is a test improvement CL. RunSettingsRoboTests still passes. Change-Id: I943ab871631cb8c368d9f9db481c00558c5c4d1f
This commit is contained in:
19
tests/robotests/src/android/print/PrintServicesLoader.java
Normal file
19
tests/robotests/src/android/print/PrintServicesLoader.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package android.print;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.content.Context;
|
||||
import android.content.Loader;
|
||||
import android.printservice.PrintServiceInfo;
|
||||
import com.android.internal.util.Preconditions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A placeholder class to prevent ClassNotFound exceptions caused by lack of visibility.
|
||||
*/
|
||||
public class PrintServicesLoader extends Loader<List<PrintServiceInfo>> {
|
||||
public PrintServicesLoader(@NonNull PrintManager printManager, @NonNull Context context,
|
||||
int selectionFlags) {
|
||||
super(Preconditions.checkNotNull(context));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user