michael@0: package org.mozilla.gecko.tests; michael@0: michael@0: import org.mozilla.gecko.Actions; michael@0: michael@0: public class testPromptGridInput extends BaseTest { michael@0: protected int index = 1; michael@0: public void testPromptGridInput() { michael@0: blockForGeckoReady(); michael@0: michael@0: test(1); michael@0: michael@0: testGridItem("Icon 1"); michael@0: testGridItem("Icon 2"); michael@0: testGridItem("Icon 3"); michael@0: testGridItem("Icon 4"); michael@0: testGridItem("Icon 5"); michael@0: testGridItem("Icon 6"); michael@0: testGridItem("Icon 7"); michael@0: testGridItem("Icon 8"); michael@0: testGridItem("Icon 9"); michael@0: testGridItem("Icon 10"); michael@0: testGridItem("Icon 11"); michael@0: michael@0: mSolo.clickOnText("Icon 11"); michael@0: mSolo.clickOnText("OK"); michael@0: michael@0: mAsserter.ok(waitForText("PASS"), "test passed", "PASS"); michael@0: mActions.sendSpecialKey(Actions.SpecialKey.BACK); michael@0: } michael@0: michael@0: public void testGridItem(String title) { michael@0: // Force the list to scroll if necessary michael@0: mSolo.waitForText(title, 1, 500, true); michael@0: mAsserter.ok(waitForText(title), "Found grid item", title); michael@0: } michael@0: michael@0: public void test(final int num) { michael@0: // Load about:blank between each test to ensure we reset state michael@0: loadUrl("about:blank"); michael@0: mAsserter.ok(waitForText("about:blank"), "Loaded blank page", "page title match"); michael@0: michael@0: loadUrl("chrome://roboextender/content/robocop_prompt_gridinput.html#test" + num); michael@0: } michael@0: }