1package com.android.test.hwuicompare;
2
3import com.android.test.hwuicompare.AutomaticActivity.FinalCallback;
4
5import android.os.Bundle;
6import android.test.ActivityInstrumentationTestCase2;
7
8public class Test extends ActivityInstrumentationTestCase2<AutomaticActivity> {
9    AutomaticActivity mActivity;
10    private Bundle mBundle;
11
12    public Test() {
13        super(AutomaticActivity.class);
14    }
15
16    @Override
17    protected void setUp() throws Exception {
18        super.setUp();
19        mBundle = new Bundle();
20        mActivity = getActivity();
21        mActivity.setFinalCallback(new FinalCallback() {
22
23            @Override
24            void report(String key, float value) {
25                mBundle.putFloat(key, value);
26            }
27            @Override
28            void complete() {
29                synchronized(mBundle) {
30                    mBundle.notify();
31                }
32            }
33        });
34    }
35
36    public void testCanvas() {
37        synchronized(mBundle) {
38            try {
39                mBundle.wait();
40            } catch (InterruptedException e) {
41                e.printStackTrace();
42            }
43        }
44        getInstrumentation().sendStatus(0, mBundle);
45    }
46}
47