public class

JankTestBase

extends InstrumentationTestCase
java.lang.Object
   ↳ junit.framework.Assert
     ↳ junit.framework.TestCase
       ↳ android.test.InstrumentationTestCase
         ↳ android.support.test.jank.JankTestBase

Class Overview

Base test class for measuring Jank. This test class automatically monitors jank while executing each test method. Each test method is executed several times in a loop, according to the 'iterations' command line parameter. To perform additional setup / tear down steps for each iteration, subclasses can optionally override beforeLoop() and afterLoop() methods. Test methods must be configured with the JankTest annotation. At minimum, the type of jank to measure and the number of expected frames must be specified.

Summary

Public Constructors
JankTestBase()
Public Methods
void afterLoop()
Called after each iteration of the test method.
void afterTest(Bundle metrics)
Called once after all iterations have completed.
void beforeLoop()
Called before each iteration of the test method.
void beforeTest()
Called once before executing a test method.
final int getCurrentIteration()
Return the index of the currently executing iteration.
Protected Methods
final Bundle getArguments()
Returns a Bundle containing the command line parameters.
void runTest()
[Expand]
Inherited Methods
From class android.test.InstrumentationTestCase
From class junit.framework.TestCase
From class junit.framework.Assert
From class java.lang.Object
From interface junit.framework.Test

Public Constructors

public JankTestBase ()

Public Methods

public void afterLoop ()

Called after each iteration of the test method.

Throws
Exception

public void afterTest (Bundle metrics)

Called once after all iterations have completed.

Note: default implementation reports the aggregated jank metrics via sendStatus(int, Bundle)

Parameters
metrics the aggregated jank metrics after looped execution

public void beforeLoop ()

Called before each iteration of the test method.

Throws
Exception

public void beforeTest ()

Called once before executing a test method.

Throws
Exception

public final int getCurrentIteration ()

Return the index of the currently executing iteration.

Protected Methods

protected final Bundle getArguments ()

Returns a Bundle containing the command line parameters.

protected void runTest ()

Throws
Throwable