1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/base/tests/testPromptGridInput.java Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +package org.mozilla.gecko.tests; 1.5 + 1.6 +import org.mozilla.gecko.Actions; 1.7 + 1.8 +public class testPromptGridInput extends BaseTest { 1.9 + protected int index = 1; 1.10 + public void testPromptGridInput() { 1.11 + blockForGeckoReady(); 1.12 + 1.13 + test(1); 1.14 + 1.15 + testGridItem("Icon 1"); 1.16 + testGridItem("Icon 2"); 1.17 + testGridItem("Icon 3"); 1.18 + testGridItem("Icon 4"); 1.19 + testGridItem("Icon 5"); 1.20 + testGridItem("Icon 6"); 1.21 + testGridItem("Icon 7"); 1.22 + testGridItem("Icon 8"); 1.23 + testGridItem("Icon 9"); 1.24 + testGridItem("Icon 10"); 1.25 + testGridItem("Icon 11"); 1.26 + 1.27 + mSolo.clickOnText("Icon 11"); 1.28 + mSolo.clickOnText("OK"); 1.29 + 1.30 + mAsserter.ok(waitForText("PASS"), "test passed", "PASS"); 1.31 + mActions.sendSpecialKey(Actions.SpecialKey.BACK); 1.32 + } 1.33 + 1.34 + public void testGridItem(String title) { 1.35 + // Force the list to scroll if necessary 1.36 + mSolo.waitForText(title, 1, 500, true); 1.37 + mAsserter.ok(waitForText(title), "Found grid item", title); 1.38 + } 1.39 + 1.40 + public void test(final int num) { 1.41 + // Load about:blank between each test to ensure we reset state 1.42 + loadUrl("about:blank"); 1.43 + mAsserter.ok(waitForText("about:blank"), "Loaded blank page", "page title match"); 1.44 + 1.45 + loadUrl("chrome://roboextender/content/robocop_prompt_gridinput.html#test" + num); 1.46 + } 1.47 +}