FileDocCategorySizeDatePackage
FrameworkPerfTest.javaAPI DocAndroid 5.1 API1547Thu Mar 12 22:22:42 GMT 2015com.android.frameworkperf

FrameworkPerfTest

public class FrameworkPerfTest extends android.test.ActivityInstrumentationTestCase2

Fields Summary
private static final int
TEST_TIMEOUT
Constructors Summary
public FrameworkPerfTest()

 //15 minutes

      
        super("com.android.frameworkperf", FrameworkPerfActivity.class);
    
Methods Summary
public voidtestFrameworkPerf()

        final FrameworkPerfActivity activity = getActivity();
        synchronized (activity.mResultNotifier) {
            getInstrumentation().runOnMainSync(new Runnable() {
                @Override
                public void run() {
                    activity.startRunning();
                }
            });
            try {
                activity.mResultNotifier.wait(TEST_TIMEOUT);
            } catch (InterruptedException e) {
                fail("test interrupted.");
            }
        }
        Bundle testResult = new Bundle();
        synchronized (activity.mResults) {
            assertTrue("test results were empty.", activity.mResults.size() > 0);
            for (RunResult result : activity.mResults) {
                testResult.putString(result.name, String.format("%f,%d,%d,%f,%d,%d",
                        result.getFgMsPerOp(), result.fgOps, result.fgTime,
                        result.getBgMsPerOp(), result.bgOps, result.bgTime));
            }
        }
        getInstrumentation().sendStatus(Activity.RESULT_OK, testResult);