Most visited

Recently visited

Added in API level 1
Deprecated since API level 24

PerformanceTestCase

public interface PerformanceTestCase

android.test.PerformanceTestCase


测试用例更复杂的接口性能。 如果你想把你的测试用作性能测试,你必须实现这个接口。

Summary

Nested classes

interface PerformanceTestCase.Intermediates

回调PerformanceTestCase 。

Public methods

abstract boolean isPerformanceOnly()

此方法用于确定此测试用例可以运行的模式。

abstract int startPerformance(PerformanceTestCase.Intermediates intermediates)

设置开始性能测试。

Public methods

isPerformanceOnly

Added in API level 1
boolean isPerformanceOnly ()

此方法用于确定此测试用例可以运行的模式。

Returns
boolean true if this test case can only be run in performance mode.

startPerformance

Added in API level 1
int startPerformance (PerformanceTestCase.Intermediates intermediates)

设置开始性能测试。 '中间体'是一个发送中间性能数字的通信通道 - 如果你使用它,你可能希望确保你的测试只返回1次执行一次。否则,返回0以允许测试装置决定数量的迭代。

如果你返回一个非零的迭代计数,你应该调用 intermediates.startTiming和 intermediates.endTiming来报告应该测量其性能的持续时间。

Parameters
intermediates PerformanceTestCase.Intermediates: Callback for sending intermediate results.
Returns
int int Maximum number of iterations to run, or 0 to let the caller decide.

Hooray!