コード例 #1
0
ファイル: InstallTimeTest.java プロジェクト: rcoscali/cts
  public void testInstallTime() throws Exception {
    final int NUMBER_REPEAT = 10;
    final CtsBuildHelper build = mBuild;
    final ITestDevice device = mDevice;
    double[] result =
        MeasureTime.measure(
            NUMBER_REPEAT,
            new MeasureRun() {
              @Override
              public void prepare(int i) throws Exception {
                device.uninstallPackage(PACKAGE);
              }

              @Override
              public void run(int i) throws Exception {
                File app = build.getTestApp(APK);
                device.installPackage(app, false);
              }
            });
    mReport.printArray("time in ms", result, false);
    StatResult stat = Stat.getStat(result);
    mReport.printSummary("time in ms", stat.mAverage, stat.mStddev);
  }