Skip to content

Most visited

Recently visited

navigation

JankTestBase

public class JankTestBase
extends InstrumentationTestCase

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


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()

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

JankTestBase

JankTestBase ()

Public methods

afterLoop

void afterLoop ()

Called after each iteration of the test method.

Throws
Exception

afterTest

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 Bundle: the aggregated jank metrics after looped execution

beforeLoop

void beforeLoop ()

Called before each iteration of the test method.

Throws
Exception

beforeTest

void beforeTest ()

Called once before executing a test method.

Throws
Exception

getCurrentIteration

int getCurrentIteration ()

Return the index of the currently executing iteration.

Returns
int

Protected methods

getArguments

Bundle getArguments ()

Returns a Bundle containing the command line parameters.

Returns
Bundle

runTest

void runTest ()

Throws
Throwable
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.