2012-12-03 04:14:27 -08:00
|
|
|
#filter substitution
|
|
|
|
package @ANDROID_PACKAGE_NAME@.tests;
|
|
|
|
|
2013-08-22 04:44:05 -07:00
|
|
|
public class testTabHistory extends BaseTest {
|
2012-12-03 04:14:27 -08:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected int getTestType() {
|
|
|
|
return TEST_MOCHITEST;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This test will check the functionality of the Back, Forward and Reload buttons.
|
|
|
|
First it will determine the Device and the OS.
|
|
|
|
Then it will create the appropriate navigation mechanisms for back, forward and reload depending on device type and OS.
|
|
|
|
Finally it will run the tests */
|
|
|
|
|
|
|
|
public void testTabHistory() {
|
|
|
|
blockForGeckoReady();
|
|
|
|
|
|
|
|
String url = getAbsoluteUrl("/robocop/robocop_blank_01.html");
|
|
|
|
String url2 = getAbsoluteUrl("/robocop/robocop_blank_02.html");
|
|
|
|
String url3 = getAbsoluteUrl("/robocop/robocop_blank_03.html");
|
|
|
|
|
|
|
|
// Create tab history
|
2013-08-22 04:44:05 -07:00
|
|
|
inputAndLoadUrl(url);
|
2013-08-19 13:33:49 -07:00
|
|
|
verifyPageTitle("Browser Blank Page 01");
|
2013-08-22 04:44:05 -07:00
|
|
|
inputAndLoadUrl(url2);
|
2013-08-19 13:33:49 -07:00
|
|
|
verifyPageTitle("Browser Blank Page 02");
|
2013-08-22 04:44:05 -07:00
|
|
|
inputAndLoadUrl(url3);
|
2013-08-19 13:33:49 -07:00
|
|
|
verifyPageTitle("Browser Blank Page 03");
|
2012-12-03 04:14:27 -08:00
|
|
|
|
|
|
|
// Get the device information and create the navigation for it
|
2013-05-15 12:47:26 -07:00
|
|
|
Navigation nav = new Navigation(mDevice);
|
|
|
|
mAsserter.dumpLog("device type: "+mDevice.type);
|
|
|
|
mAsserter.dumpLog("device version: "+mDevice.version);
|
|
|
|
mAsserter.dumpLog("device width: "+mDevice.width);
|
|
|
|
mAsserter.dumpLog("device height: "+mDevice.height);
|
2012-12-03 04:14:27 -08:00
|
|
|
|
|
|
|
// Go to the 2nd page
|
|
|
|
nav.back();
|
2013-02-27 07:21:24 -08:00
|
|
|
waitForText("Browser Blank Page 02");
|
2013-02-19 11:02:15 -08:00
|
|
|
verifyPageTitle("Browser Blank Page 02");
|
2012-12-03 04:14:27 -08:00
|
|
|
|
|
|
|
// Go to the first page
|
|
|
|
nav.back();
|
2013-02-27 07:21:24 -08:00
|
|
|
waitForText("Browser Blank Page 01");
|
2012-12-03 04:14:27 -08:00
|
|
|
verifyPageTitle("Browser Blank Page 01");
|
|
|
|
|
|
|
|
// Go forward to the second page
|
|
|
|
nav.forward();
|
2013-02-27 07:21:24 -08:00
|
|
|
waitForText("Browser Blank Page 02");
|
2012-12-03 04:14:27 -08:00
|
|
|
verifyPageTitle("Browser Blank Page 02");
|
|
|
|
|
|
|
|
// Reload page
|
|
|
|
nav.reload();
|
2013-02-27 07:21:24 -08:00
|
|
|
waitForText("Browser Blank Page 02");
|
2012-12-03 04:14:27 -08:00
|
|
|
verifyPageTitle("Browser Blank Page 02");
|
|
|
|
}
|
|
|
|
}
|