public class ActivityTestsBase extends AndroidTestCase implements PerformanceTestCase, LaunchpadActivity.CallingTest
PerformanceTestCase.Intermediates
Modifier and Type | Field and Description |
---|---|
protected Intent |
mIntent |
static String |
PERMISSION_DENIED |
static String |
PERMISSION_GRANTED |
mContext
Constructor and Description |
---|
ActivityTestsBase() |
Modifier and Type | Method and Description |
---|---|
void |
activityFinished(int resultCode,
Intent data,
RuntimeException where) |
void |
addIntermediate(String name) |
void |
addIntermediate(String name,
long timeInNS) |
Intent |
editIntent() |
void |
finishBad(String error) |
void |
finishGood() |
void |
finishTiming(boolean realTime) |
void |
finishWithResult(int resultCode,
Intent data) |
void |
finishWithResult(int resultCode,
Intent data,
RuntimeException where) |
Context |
getContext() |
int |
getResultCode() |
Intent |
getResultData() |
RuntimeException |
getResultStack() |
boolean |
isPerformanceOnly()
This method is used to determine what modes this test case can run in.
|
void |
onTimeout() |
int |
runLaunchpad(String action) |
void |
setInternalIterations(int count) |
protected void |
setUp() |
int |
startPerformance(PerformanceTestCase.Intermediates intermediates)
Set up to begin performance tests.
|
void |
startTiming(boolean realTime) |
protected void |
tearDown() |
int |
waitForResult(int timeoutMs,
String expected) |
int |
waitForResultOrThrow(int timeoutMs) |
int |
waitForResultOrThrow(int timeoutMs,
String expected) |
assertActivityRequiresPermission, assertReadingContentUriRequiresPermission, assertWritingContentUriRequiresPermission, getTestContext, scrubClass, setContext, setTestContext, testAndroidTestCaseSetupProperly
public static final String PERMISSION_GRANTED
public static final String PERMISSION_DENIED
protected Intent mIntent
protected void setUp() throws Exception
setUp
in class AndroidTestCase
Exception
protected void tearDown() throws Exception
tearDown
in class AndroidTestCase
Exception
public boolean isPerformanceOnly()
PerformanceTestCase
isPerformanceOnly
in interface PerformanceTestCase
public void setInternalIterations(int count)
setInternalIterations
in interface PerformanceTestCase.Intermediates
public void startTiming(boolean realTime)
startTiming
in interface LaunchpadActivity.CallingTest
startTiming
in interface PerformanceTestCase.Intermediates
public void addIntermediate(String name)
addIntermediate
in interface LaunchpadActivity.CallingTest
addIntermediate
in interface PerformanceTestCase.Intermediates
public void addIntermediate(String name, long timeInNS)
addIntermediate
in interface LaunchpadActivity.CallingTest
addIntermediate
in interface PerformanceTestCase.Intermediates
public void finishTiming(boolean realTime)
finishTiming
in interface LaunchpadActivity.CallingTest
finishTiming
in interface PerformanceTestCase.Intermediates
public void activityFinished(int resultCode, Intent data, RuntimeException where)
activityFinished
in interface LaunchpadActivity.CallingTest
public Intent editIntent()
public Context getContext()
getContext
in class AndroidTestCase
public int startPerformance(PerformanceTestCase.Intermediates intermediates)
PerformanceTestCase
If you return a non-zero iteration count, you should call
intermediates.startTiming
and
intermediates.endTiming
to report the
duration of the test whose performance should actually be measured.
startPerformance
in interface PerformanceTestCase
intermediates
- Callback for sending intermediate results.public void finishGood()
public void finishBad(String error)
public void finishWithResult(int resultCode, Intent data)
public void finishWithResult(int resultCode, Intent data, RuntimeException where)
public int runLaunchpad(String action)
public int waitForResultOrThrow(int timeoutMs)
public int waitForResultOrThrow(int timeoutMs, String expected)
public int waitForResult(int timeoutMs, String expected)
public int getResultCode()
public Intent getResultData()
public RuntimeException getResultStack()
public void onTimeout()