Merge change 21589 into eclair

* changes:
  Fix bug 2056252: android.test.AndroidTestRunnerTest:testRunTestWithNullListener is failing - Verify mInstrumentation is not null before calling getContext()
This commit is contained in:
Android (Google) Code Review
2009-08-18 20:16:46 -07:00

View File

@@ -158,7 +158,7 @@ public class AndroidTestRunner extends BaseTestRunner {
mTestResult.addListener(testListener); mTestResult.addListener(testListener);
} }
Context testContext = mInstrumentation.getContext(); Context testContext = mInstrumentation == null ? mContext : mInstrumentation.getContext();
for (TestCase testCase : mTestCases) { for (TestCase testCase : mTestCases) {
setContextIfAndroidTestCase(testCase, mContext, testContext); setContextIfAndroidTestCase(testCase, mContext, testContext);
setInstrumentationIfInstrumentationTestCase(testCase, mInstrumentation); setInstrumentationIfInstrumentationTestCase(testCase, mInstrumentation);