From cbc584d7ebe332f78bf8012d21265ccb482c7cfc Mon Sep 17 00:00:00 2001 From: David Hu Date: Fri, 16 Sep 2011 18:08:35 -0700 Subject: Return the bundle object Added the ability for the test runner to return the bundle object so the tests can get access to input arguments Change-Id: I73a704bb2279238bd91a376aacecbe5f607af649 --- test-runner/src/android/test/InstrumentationTestRunner.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test-runner/src') diff --git a/test-runner/src/android/test/InstrumentationTestRunner.java b/test-runner/src/android/test/InstrumentationTestRunner.java index c3d09ff..70cf89e 100644 --- a/test-runner/src/android/test/InstrumentationTestRunner.java +++ b/test-runner/src/android/test/InstrumentationTestRunner.java @@ -279,6 +279,7 @@ public class InstrumentationTestRunner extends Instrumentation implements TestSu private static final String LOG_TAG = "InstrumentationTestRunner"; private final Bundle mResults = new Bundle(); + private Bundle mArguments; private AndroidTestRunner mTestRunner; private boolean mDebug; private boolean mJustCount; @@ -292,6 +293,7 @@ public class InstrumentationTestRunner extends Instrumentation implements TestSu @Override public void onCreate(Bundle arguments) { super.onCreate(arguments); + mArguments = arguments; // Apk paths used to search for test classes when using TestSuiteBuilders. String[] apkPaths = @@ -379,6 +381,16 @@ public class InstrumentationTestRunner extends Instrumentation implements TestSu start(); } + /** + * Get the Bundle object that contains the arguments + * + * @return the Bundle object + * @hide + */ + public Bundle getBundle(){ + return mArguments; + } + List> getBuilderRequirements() { return new ArrayList>(); } -- cgit v1.1