Skip to content

Commit cbc584d

Browse files
author
David Hu
committed
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
1 parent 2f2eea7 commit cbc584d

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test-runner/src/android/test/InstrumentationTestRunner.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ public class InstrumentationTestRunner extends Instrumentation implements TestSu
279279
private static final String LOG_TAG = "InstrumentationTestRunner";
280280

281281
private final Bundle mResults = new Bundle();
282+
private Bundle mArguments;
282283
private AndroidTestRunner mTestRunner;
283284
private boolean mDebug;
284285
private boolean mJustCount;
@@ -292,6 +293,7 @@ public class InstrumentationTestRunner extends Instrumentation implements TestSu
292293
@Override
293294
public void onCreate(Bundle arguments) {
294295
super.onCreate(arguments);
296+
mArguments = arguments;
295297

296298
// Apk paths used to search for test classes when using TestSuiteBuilders.
297299
String[] apkPaths =
@@ -379,6 +381,16 @@ public void onCreate(Bundle arguments) {
379381
start();
380382
}
381383

384+
/**
385+
* Get the Bundle object that contains the arguments
386+
*
387+
* @return the Bundle object
388+
* @hide
389+
*/
390+
public Bundle getBundle(){
391+
return mArguments;
392+
}
393+
382394
List<Predicate<TestMethod>> getBuilderRequirements() {
383395
return new ArrayList<Predicate<TestMethod>>();
384396
}

0 commit comments

Comments
 (0)