Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c69a8807 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 22109 into eclair

* changes:
  Fix bug 1546445: Correct spelling errors in API - InstrumentationTestCase.injectInsrumentation - AndroidTestRunner.setInstrumentaiton
parents 77f77f90 7aba54b2
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -118540,6 +118540,19 @@
>
</constructor>
<method name="addTestListener"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="instrumentation" type="android.app.Instrumentation">
</parameter>
</method>
<method name="setInstrumentation"
 return="void"
 abstract="false"
 native="false"
@@ -118789,6 +118802,19 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="instrumentation" type="android.app.Instrumentation">
</parameter>
</method>
<method name="injectInstrumentation"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
+15 −1
Original line number Diff line number Diff line
@@ -43,10 +43,24 @@ public class InstrumentationTestCase extends TestCase {
     * 
     * @param instrumentation the instrumentation to use with this instance
     */
    public void injectInsrumentation(Instrumentation instrumentation) {
    public void injectInstrumentation(Instrumentation instrumentation) {
        mInstrumentation = instrumentation;
    }

    /**
     * Injects instrumentation into this test case. This method is
     * called by the test runner during test setup.
     *
     * @param instrumentation the instrumentation to use with this instance
     *
     * @deprecated Incorrect spelling,
     * use {@link #injectInstrumentation(android.app.Instrumentation) instead.
     */
    @Deprecated
    public void injectInsrumentation(Instrumentation instrumentation) {
        injectInstrumentation(instrumentation);
    }

    /**
     * Inheritors can access the instrumentation using this.
     * @return instrumentation
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public class InstrumentationTestSuite extends TestSuite {
    public void runTest(Test test, TestResult result) {

        if (test instanceof InstrumentationTestCase) {
            ((InstrumentationTestCase) test).injectInsrumentation(mInstrumentation);
            ((InstrumentationTestCase) test).injectInstrumentation(mInstrumentation);
        }

        // run the test as usual
+11 −2
Original line number Diff line number Diff line
@@ -180,14 +180,23 @@ public class AndroidTestRunner extends BaseTestRunner {
    private void setInstrumentationIfInstrumentationTestCase(
            Test test, Instrumentation instrumentation) {
        if (InstrumentationTestCase.class.isAssignableFrom(test.getClass())) {
            ((InstrumentationTestCase) test).injectInsrumentation(instrumentation);
            ((InstrumentationTestCase) test).injectInstrumentation(instrumentation);
        }
    }

    public void setInstrumentaiton(Instrumentation instrumentation) {
    public void setInstrumentation(Instrumentation instrumentation) {
        mInstrumentation = instrumentation;
    }

    /**
     * @deprecated Incorrect spelling,
     * use {@link #setInstrumentation(android.app.Instrumentation)} instead.
     */
    @Deprecated
    public void setInstrumentaiton(Instrumentation instrumentation) {
        setInstrumentation(instrumentation);
    }

    @Override
    protected Class loadSuiteClass(String suiteClassName) throws ClassNotFoundException {
        return mContext.getClassLoader().loadClass(suiteClassName);
+1 −1
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ public class InstrumentationTestRunner extends Instrumentation implements TestSu

        mTestRunner = getAndroidTestRunner();
        mTestRunner.setContext(getTargetContext());
        mTestRunner.setInstrumentaiton(this);
        mTestRunner.setInstrumentation(this);
        mTestRunner.setSkipExecution(logOnly);
        mTestRunner.setTest(testSuiteBuilder.build());
        mTestCount = mTestRunner.getTestCases().size();