OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2015 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 package com.skia; |
| 9 |
| 10 import android.app.Instrumentation; |
| 11 import android.content.Intent; |
| 12 import android.test.ActivityUnitTestCase; |
| 13 import android.util.Log; |
| 14 |
| 15 public class VisualBenchTestActivity extends ActivityUnitTestCase<VisualBenchAct
ivity> { |
| 16 private VisualBenchActivity mActivity; |
| 17 private Instrumentation mInstrumentation; |
| 18 |
| 19 public VisualBenchTestActivity() { |
| 20 super(VisualBenchActivity.class); |
| 21 } |
| 22 |
| 23 protected void setUp() throws Exception { |
| 24 super.setUp(); |
| 25 mInstrumentation = getInstrumentation(); |
| 26 } |
| 27 |
| 28 public void testVisualBench() throws InterruptedException { |
| 29 String pkg = getInstrumentation().getTargetContext().getPackageName(); |
| 30 Intent intent = new Intent(getInstrumentation().getTargetContext(), |
| 31 VisualBenchActivity.class); |
| 32 intent.putExtra("cmdLineFlags", ""); |
| 33 mActivity = launchActivityWithIntent(pkg, VisualBenchActivity.class, int
ent); |
| 34 |
| 35 assertNotNull("mActivity is null", mActivity); |
| 36 Thread.sleep(5000); |
| 37 while (!mActivity.isDestroyed()) { |
| 38 Log.d("skiatest", "Waiting for subprocess to finish."); |
| 39 Thread.sleep(1000); |
| 40 } |
| 41 } |
| 42 } |
OLD | NEW |