2012-11-12 10:49:26 -08:00
|
|
|
#filter substitution
|
|
|
|
package @ANDROID_PACKAGE_NAME@.tests;
|
|
|
|
|
|
|
|
import com.jayway.android.robotium.solo.Solo;
|
|
|
|
|
|
|
|
import android.widget.ListView;
|
|
|
|
import android.widget.TabWidget;
|
|
|
|
import android.support.v4.view.ViewPager;
|
|
|
|
|
|
|
|
import @ANDROID_PACKAGE_NAME@.*;
|
|
|
|
|
2013-04-18 20:18:05 -07:00
|
|
|
/* Tests swiping between tabs on the awesome bar and other basic
|
|
|
|
awesome bar tab selections.
|
2012-11-12 10:49:26 -08:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class testAwesomebarSwipes extends BaseTest {
|
|
|
|
@Override
|
|
|
|
protected int getTestType() {
|
|
|
|
return TEST_MOCHITEST;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void testAwesomebarSwipes() {
|
2013-04-18 20:18:05 -07:00
|
|
|
blockForGeckoReady();
|
2012-11-12 10:49:26 -08:00
|
|
|
|
2013-07-25 15:10:45 -07:00
|
|
|
// Removed by Bug 896576 - [fig] Remove [getAllPagesList] from BaseTest
|
|
|
|
// ListView list = getAllPagesList("about:firefox");
|
2012-11-12 10:49:26 -08:00
|
|
|
|
|
|
|
// Test normal sliding of the list left and right
|
|
|
|
ViewPager pager = (ViewPager)mSolo.getView(ViewPager.class, 0);
|
|
|
|
mAsserter.is(pager.getCurrentItem(), 0, "All pages is selected");
|
|
|
|
|
2012-12-27 04:09:11 -08:00
|
|
|
int width = mDriver.getGeckoWidth() / 2;
|
|
|
|
int y = mDriver.getGeckoHeight() / 2;
|
|
|
|
mActions.drag(width, 0, y, y);
|
2012-11-12 10:49:26 -08:00
|
|
|
mAsserter.is(pager.getCurrentItem(), 1, "Bookmarks page is selected");
|
|
|
|
|
2012-12-27 04:09:11 -08:00
|
|
|
mActions.drag(0, width, y, y);
|
2012-11-12 10:49:26 -08:00
|
|
|
mAsserter.is(pager.getCurrentItem(), 0, "All pages is selected");
|
|
|
|
|
|
|
|
// Test tapping on the tab strip changes tabs
|
|
|
|
TabWidget tabwidget = (TabWidget)mSolo.getView(TabWidget.class, 0);
|
|
|
|
mSolo.clickOnView(tabwidget.getChildAt(1));
|
|
|
|
mAsserter.is(pager.getCurrentItem(), 1, "Clicking on tab selected bookmarks page");
|
|
|
|
|
|
|
|
// Test typing in the awesomebar changes tabs and prevents panning
|
|
|
|
mSolo.typeText(0, "woot");
|
|
|
|
mAsserter.is(pager.getCurrentItem(), 0, "Searching switched to all pages tab");
|
|
|
|
mSolo.scrollToSide(Solo.LEFT);
|
|
|
|
mAsserter.is(pager.getCurrentItem(), 0, "Dragging left is not allowed when searching");
|
|
|
|
|
|
|
|
mSolo.scrollToSide(Solo.RIGHT);
|
|
|
|
mAsserter.is(pager.getCurrentItem(), 0, "Dragging right is not allowed when searching");
|
|
|
|
|
|
|
|
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
|
|
|
|
}
|
|
|
|
}
|