aboutsummaryrefslogtreecommitdiff
path: root/tests/func/src/com/android/tv/tests/ui/ChannelBannerViewTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/func/src/com/android/tv/tests/ui/ChannelBannerViewTest.java')
-rw-r--r--tests/func/src/com/android/tv/tests/ui/ChannelBannerViewTest.java49
1 files changed, 30 insertions, 19 deletions
diff --git a/tests/func/src/com/android/tv/tests/ui/ChannelBannerViewTest.java b/tests/func/src/com/android/tv/tests/ui/ChannelBannerViewTest.java
index d8a4aec1..600b52b6 100644
--- a/tests/func/src/com/android/tv/tests/ui/ChannelBannerViewTest.java
+++ b/tests/func/src/com/android/tv/tests/ui/ChannelBannerViewTest.java
@@ -16,37 +16,48 @@
package com.android.tv.tests.ui;
-import static com.android.tv.testing.uihelper.UiDeviceAsserts.assertWaitForCondition;
-
-import android.support.test.filters.SmallTest;
+import android.support.test.filters.MediumTest;
import android.support.test.uiautomator.Until;
-
import com.android.tv.R;
import com.android.tv.testing.uihelper.Constants;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+/** Tests for {@link com.android.tv.ui.ChannelBannerView} */
+@MediumTest
+@RunWith(JUnit4.class)
+public class ChannelBannerViewTest {
+ @Rule public final LiveChannelsTestController controller = new LiveChannelsTestController();
-@SmallTest
-public class ChannelBannerViewTest extends LiveChannelsTestCase {
// Channel banner show duration with the grace period.
private long mShowDurationMillis;
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- mLiveChannelsHelper.assertAppStarted();
- mShowDurationMillis = mTargetResources.getInteger(R.integer.channel_banner_show_duration)
- + Constants.MAX_SHOW_DELAY_MILLIS;
+ @Before
+ public void setUp() throws Exception {
+ controller.liveChannelsHelper.assertAppStarted();
+ mShowDurationMillis =
+ controller.getTargetResources().getInteger(R.integer.channel_banner_show_duration)
+ + Constants.MAX_SHOW_DELAY_MILLIS;
}
+ @Ignore("b/73727914")
+ @Test
public void testChannelBannerAppearDisappear() {
- mDevice.pressDPadCenter();
- assertWaitForCondition(mDevice, Until.hasObject(Constants.CHANNEL_BANNER));
- assertWaitForCondition(mDevice, Until.gone(Constants.CHANNEL_BANNER), mShowDurationMillis);
+ controller.pressDPadCenter();
+ controller.assertWaitForCondition(Until.hasObject(Constants.CHANNEL_BANNER));
+ controller.assertWaitForCondition(
+ Until.gone(Constants.CHANNEL_BANNER), mShowDurationMillis);
}
+ @Test
public void testChannelBannerShownWhenTune() {
- mDevice.pressDPadDown();
- assertWaitForCondition(mDevice, Until.hasObject(Constants.CHANNEL_BANNER));
- mDevice.pressDPadUp();
- assertWaitForCondition(mDevice, Until.hasObject(Constants.CHANNEL_BANNER));
+ controller.pressDPadDown();
+ controller.assertWaitForCondition(Until.hasObject(Constants.CHANNEL_BANNER));
+ controller.pressDPadUp();
+ controller.assertWaitForCondition(Until.hasObject(Constants.CHANNEL_BANNER));
}
}