FileDocCategorySizeDatePackage
RsBenchTest.javaAPI DocAndroid 5.1 API2433Thu Mar 12 22:22:44 GMT 2015com.android.perftest

RsBenchTest

public class RsBenchTest extends android.test.ActivityInstrumentationTestCase2
To run the test, please use command adb shell am instrument -w com.android.perftest/.RsPerfTestRunner

Fields Summary
private String
TAG
private int
iterations
private RsBench
mAct
Constructors Summary
public RsBenchTest()


      
        super(RsBench.class);
    
Methods Summary
public voidsetUp()

        super.setUp();
        Instrumentation mInst = getInstrumentation();
        RsPerfTestRunner mRunner = (RsPerfTestRunner) getInstrumentation();
        iterations = mRunner.iterations;
        Log.v(TAG, "Run benchmark for " + iterations + " iterations.");

        Uri data = Uri.fromParts("iterations", Integer.toString(iterations), null);
        Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setClassName("com.android.perftest", "com.android.perftest.RsBench");
        intent.setData(data);
        mAct = (RsBench) mInst.startActivitySync(intent);
        mInst.waitForIdleSync();

    
public voidtearDown()

        mAct.finish();
        super.tearDown();
    
public voidtestRsBench()
Run tests and wait until the test has been run for iterations.

        if (mAct.mView.testIsFinished()) {
            return;
        } else {
            fail("test didn't stop correctly");
        }