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.
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 | |
---|---|
IMonitorFactory
|
createMonitorFactory()
Creates an |
final
Bundle
|
getArguments()
Returns a |
IMonitorFactory
|
getMonitorFactory()
Returns the |
List<IMonitor>
|
getMonitors(Method method)
Returns the list of |
void
|
runTest()
|
Inherited methods | |
---|---|
![]()
android.test.InstrumentationTestCase
| |
![]()
junit.framework.TestCase
| |
![]()
junit.framework.Assert
| |
![]()
java.lang.Object
| |
![]()
junit.framework.Test
|
JankTestBase ()
void afterLoop ()
Called after each iteration of the test method.
Throws | |
---|---|
Exception |
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
|
void beforeLoop ()
Called before each iteration of the test method.
Throws | |
---|---|
Exception |
void beforeTest ()
Called once before executing a test method.
Throws | |
---|---|
Exception |
int getCurrentIteration ()
Return the index of the currently executing iteration.
Returns | |
---|---|
int |
IMonitorFactory createMonitorFactory ()
Creates an IMonitorFactory
instance that should be used to construct
IMonitor
(s) for the test methods in this class.
Returns | |
---|---|
IMonitorFactory |
Bundle getArguments ()
Returns a Bundle
containing the command line parameters.
Returns | |
---|---|
Bundle |
IMonitorFactory getMonitorFactory ()
Returns the IMonitorFactory
instance that should be used to construct applicable
IMonitor
(s) for a given test method.
Returns | |
---|---|
IMonitorFactory |
List<IMonitor> getMonitors (Method method)
Returns the list of IMonitor
s that should be applied to the given method
.
Parameters | |
---|---|
method |
Method
|
Returns | |
---|---|
List<IMonitor> |
void runTest ()
Throws | |
---|---|
Throwable |