Loading packages/SettingsLib/tests/robotests/Android.mk +2 −2 Original line number Original line Diff line number Diff line Loading @@ -49,7 +49,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \ LOCAL_JAVA_LIBRARIES := \ LOCAL_JAVA_LIBRARIES := \ junit \ junit \ platform-robolectric-3.4.2-prebuilt platform-robolectric-3.5.1-prebuilt LOCAL_INSTRUMENTATION_FOR := SettingsLibShell LOCAL_INSTRUMENTATION_FOR := SettingsLibShell LOCAL_MODULE := SettingsLibRoboTests LOCAL_MODULE := SettingsLibRoboTests Loading @@ -74,4 +74,4 @@ LOCAL_TEST_PACKAGE := SettingsLibShell LOCAL_ROBOTEST_TIMEOUT := 36000 LOCAL_ROBOTEST_TIMEOUT := 36000 include prebuilts/misc/common/robolectric/3.4.2/run_robotests.mk include prebuilts/misc/common/robolectric/3.5.1/run_robotests.mk packages/SettingsLib/tests/robotests/src/com/android/settingslib/SettingsLibRobolectricTestRunner.java +14 −21 Original line number Original line Diff line number Diff line Loading @@ -38,20 +38,11 @@ public class SettingsLibRobolectricTestRunner extends RobolectricTestRunner { final String resDir = appRoot + "/tests/robotests/res"; final String resDir = appRoot + "/tests/robotests/res"; final String assetsDir = appRoot + config.assetDir(); final String assetsDir = appRoot + config.assetDir(); final AndroidManifest manifest = new AndroidManifest(Fs.fileFromPath(manifestPath), return new AndroidManifest(Fs.fileFromPath(manifestPath), Fs.fileFromPath(resDir), Fs.fileFromPath(resDir), Fs.fileFromPath(assetsDir)) { Fs.fileFromPath(assetsDir), "com.android.settingslib") { @Override @Override public List<ResourcePath> getIncludedResourcePaths() { public List<ResourcePath> getIncludedResourcePaths() { List<ResourcePath> paths = super.getIncludedResourcePaths(); List<ResourcePath> paths = super.getIncludedResourcePaths(); SettingsLibRobolectricTestRunner.getIncludedResourcePaths(getPackageName(), paths); return paths; } }; manifest.setPackageName("com.android.settingslib"); return manifest; } static void getIncludedResourcePaths(String packageName, List<ResourcePath> paths) { paths.add(new ResourcePath( paths.add(new ResourcePath( null, null, Fs.fileFromPath("./frameworks/base/packages/SettingsLib/res"), Fs.fileFromPath("./frameworks/base/packages/SettingsLib/res"), Loading @@ -64,6 +55,8 @@ public class SettingsLibRobolectricTestRunner extends RobolectricTestRunner { null, null, Fs.fileFromPath("./frameworks/support/v7/appcompat/res"), Fs.fileFromPath("./frameworks/support/v7/appcompat/res"), null)); null)); return paths; } }; } } } } Loading
packages/SettingsLib/tests/robotests/Android.mk +2 −2 Original line number Original line Diff line number Diff line Loading @@ -49,7 +49,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \ LOCAL_JAVA_LIBRARIES := \ LOCAL_JAVA_LIBRARIES := \ junit \ junit \ platform-robolectric-3.4.2-prebuilt platform-robolectric-3.5.1-prebuilt LOCAL_INSTRUMENTATION_FOR := SettingsLibShell LOCAL_INSTRUMENTATION_FOR := SettingsLibShell LOCAL_MODULE := SettingsLibRoboTests LOCAL_MODULE := SettingsLibRoboTests Loading @@ -74,4 +74,4 @@ LOCAL_TEST_PACKAGE := SettingsLibShell LOCAL_ROBOTEST_TIMEOUT := 36000 LOCAL_ROBOTEST_TIMEOUT := 36000 include prebuilts/misc/common/robolectric/3.4.2/run_robotests.mk include prebuilts/misc/common/robolectric/3.5.1/run_robotests.mk
packages/SettingsLib/tests/robotests/src/com/android/settingslib/SettingsLibRobolectricTestRunner.java +14 −21 Original line number Original line Diff line number Diff line Loading @@ -38,20 +38,11 @@ public class SettingsLibRobolectricTestRunner extends RobolectricTestRunner { final String resDir = appRoot + "/tests/robotests/res"; final String resDir = appRoot + "/tests/robotests/res"; final String assetsDir = appRoot + config.assetDir(); final String assetsDir = appRoot + config.assetDir(); final AndroidManifest manifest = new AndroidManifest(Fs.fileFromPath(manifestPath), return new AndroidManifest(Fs.fileFromPath(manifestPath), Fs.fileFromPath(resDir), Fs.fileFromPath(resDir), Fs.fileFromPath(assetsDir)) { Fs.fileFromPath(assetsDir), "com.android.settingslib") { @Override @Override public List<ResourcePath> getIncludedResourcePaths() { public List<ResourcePath> getIncludedResourcePaths() { List<ResourcePath> paths = super.getIncludedResourcePaths(); List<ResourcePath> paths = super.getIncludedResourcePaths(); SettingsLibRobolectricTestRunner.getIncludedResourcePaths(getPackageName(), paths); return paths; } }; manifest.setPackageName("com.android.settingslib"); return manifest; } static void getIncludedResourcePaths(String packageName, List<ResourcePath> paths) { paths.add(new ResourcePath( paths.add(new ResourcePath( null, null, Fs.fileFromPath("./frameworks/base/packages/SettingsLib/res"), Fs.fileFromPath("./frameworks/base/packages/SettingsLib/res"), Loading @@ -64,6 +55,8 @@ public class SettingsLibRobolectricTestRunner extends RobolectricTestRunner { null, null, Fs.fileFromPath("./frameworks/support/v7/appcompat/res"), Fs.fileFromPath("./frameworks/support/v7/appcompat/res"), null)); null)); return paths; } }; } } } }