diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/dialer/widget/ActionBarControllerTest.java | 47 |
1 files changed, 9 insertions, 38 deletions
diff --git a/tests/src/com/android/dialer/widget/ActionBarControllerTest.java b/tests/src/com/android/dialer/widget/ActionBarControllerTest.java index 2e388380f..316c15537 100644 --- a/tests/src/com/android/dialer/widget/ActionBarControllerTest.java +++ b/tests/src/com/android/dialer/widget/ActionBarControllerTest.java @@ -16,54 +16,25 @@ package com.android.dialer.widget; -import android.app.ActionBar; -import android.app.Activity; import android.content.Context; -import android.test.ActivityInstrumentationTestCase2; -import android.test.AndroidTestCase; import android.test.InstrumentationTestCase; import android.test.suitebuilder.annotation.SmallTest; -import android.view.View; -import com.android.dialer.DialtactsActivity; import com.android.dialer.widget.ActionBarController.ActivityUi; -import com.android.internal.app.WindowDecorActionBar; @SmallTest -public class ActionBarControllerTest extends ActivityInstrumentationTestCase2<DialtactsActivity> { +public class ActionBarControllerTest extends InstrumentationTestCase { private static final int ACTION_BAR_HEIGHT = 100; private ActionBarController mActionBarController; private SearchEditTextLayout mSearchBox; private MockActivityUi mActivityUi; - private class MockActionBar extends WindowDecorActionBar { - private int mHideOffset = 0; - - public MockActionBar(Activity activity) { - super(activity); - } - - @Override - public void setHideOffset(int offset) { - mHideOffset = offset; - } - - @Override - public int getHideOffset() { - return mHideOffset; - } - } - private class MockActivityUi implements ActivityUi { boolean isInSearchUi; boolean hasSearchQuery; boolean shouldShowActionBar; - private ActionBar mActionBar; - - public MockActivityUi() { - mActionBar = new MockActionBar(getActivity()); - } + int actionBarHideOffset; @Override public boolean isInSearchUi() { @@ -86,8 +57,13 @@ public class ActionBarControllerTest extends ActivityInstrumentationTestCase2<Di } @Override - public ActionBar getActionBar() { - return mActionBar; + public int getActionBarHideOffset() { + return actionBarHideOffset; + } + + @Override + public void setActionBarHideOffset(int offset) { + actionBarHideOffset = offset; } } @@ -111,11 +87,6 @@ public class ActionBarControllerTest extends ActivityInstrumentationTestCase2<Di } } - public ActionBarControllerTest() { - super(DialtactsActivity.class); - } - - @Override protected void setUp() { mActivityUi = new MockActivityUi(); |