aboutsummaryrefslogtreecommitdiff
path: root/tests/func/src/com/android/tv/tests/ui/ChannelSourcesTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/func/src/com/android/tv/tests/ui/ChannelSourcesTest.java')
-rw-r--r--tests/func/src/com/android/tv/tests/ui/ChannelSourcesTest.java32
1 files changed, 22 insertions, 10 deletions
diff --git a/tests/func/src/com/android/tv/tests/ui/ChannelSourcesTest.java b/tests/func/src/com/android/tv/tests/ui/ChannelSourcesTest.java
index 9959185f..27d8824e 100644
--- a/tests/func/src/com/android/tv/tests/ui/ChannelSourcesTest.java
+++ b/tests/func/src/com/android/tv/tests/ui/ChannelSourcesTest.java
@@ -23,36 +23,48 @@ import android.test.suitebuilder.annotation.LargeTest;
import com.android.tv.R;
import com.android.tv.testing.uihelper.ByResource;
-import com.android.tv.testing.uihelper.SidePanelHelper;
/**
* Tests for channel sources.
*/
@LargeTest
public class ChannelSourcesTest extends LiveChannelsTestCase {
- private SidePanelHelper mSidePanelHelper;
- private BySelector mByChannelSourceSidePanel;
+ private BySelector mBySettingsSidePanel;
@Override
protected void setUp() throws Exception {
super.setUp();
- mSidePanelHelper = new SidePanelHelper(mDevice, mTargetResources);
- mByChannelSourceSidePanel = mSidePanelHelper
- .bySidePanelTitled(R.string.side_panel_title_channel_sources);
+ mBySettingsSidePanel = mSidePanelHelper.bySidePanelTitled(
+ R.string.side_panel_title_settings);
}
//TODO: create a cancelable test channel setup.
public void testSetup_cancel() {
mLiveChannelsHelper.assertAppStarted();
- mMenuHelper.assertPressOptionsChannelSources();
- assertWaitForCondition(mDevice, Until.hasObject(mByChannelSourceSidePanel));
+ mMenuHelper.assertPressOptionsSettings();
+ assertWaitForCondition(mDevice, Until.hasObject(mBySettingsSidePanel));
- mSidePanelHelper.assertNavigateToItem(R.string.channel_source_item_setup);
+ mSidePanelHelper.assertNavigateToItem(R.string.settings_channel_source_item_setup);
mDevice.pressDPadCenter();
assertWaitForCondition(mDevice,
- Until.hasObject(ByResource.text(mTargetResources, R.string.setup_title)));
+ Until.hasObject(ByResource.text(mTargetResources, R.string.setup_sources_text)));
+ mDevice.pressBack();
+ }
+
+ // SetupSourcesFragment should have no errors if side fragment item is clicked multiple times.
+ public void testSetupTwice_cancel() {
+ mLiveChannelsHelper.assertAppStarted();
+ mMenuHelper.assertPressOptionsSettings();
+ assertWaitForCondition(mDevice, Until.hasObject(mBySettingsSidePanel));
+
+ mSidePanelHelper.assertNavigateToItem(R.string.settings_channel_source_item_setup);
+ mDevice.pressDPadCenter();
+ mDevice.pressDPadCenter();
+
+ assertWaitForCondition(mDevice,
+ Until.hasObject(ByResource.text(mTargetResources, R.string.setup_sources_text)));
mDevice.pressBack();
}
}