diff options
Diffstat (limited to 'tests/CanvasCompare/src/com/android/test/hwuicompare/Test.java')
-rw-r--r-- | tests/CanvasCompare/src/com/android/test/hwuicompare/Test.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/CanvasCompare/src/com/android/test/hwuicompare/Test.java b/tests/CanvasCompare/src/com/android/test/hwuicompare/Test.java new file mode 100644 index 0000000..6ea8237 --- /dev/null +++ b/tests/CanvasCompare/src/com/android/test/hwuicompare/Test.java @@ -0,0 +1,46 @@ +package com.android.test.hwuicompare; + +import com.android.test.hwuicompare.AutomaticActivity.TestCallback; + +import android.os.Bundle; +import android.test.ActivityInstrumentationTestCase2; + +public class Test extends ActivityInstrumentationTestCase2<AutomaticActivity> { + AutomaticActivity mActivity; + private Bundle mBundle; + + public Test() { + super(AutomaticActivity.class); + } + + @Override + protected void setUp() throws Exception { + super.setUp(); + mBundle = new Bundle(); + mActivity = getActivity(); + mActivity.setCallback(new TestCallback() { + + @Override + void report(String key, float value) { + mBundle.putFloat(key, value); + } + @Override + void complete() { + synchronized(mBundle) { + mBundle.notify(); + } + } + }); + } + + public void testCanvas() { + synchronized(mBundle) { + try { + mBundle.wait(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + getInstrumentation().sendStatus(0, mBundle); + } +} |