gecko-dev/mobile/android/base/tests/testTabHistory.java.in
Brian Nicholson fe44f36220 Bug 850487 - More code cleanup (@Overrides and unused imports). r=kats
--HG--
extra : rebase_source : 376574e0c41b91c16a6be335584a4a61768bb4a9
2013-03-13 13:20:57 -07:00

57 lines
1.8 KiB
Java

#filter substitution
package @ANDROID_PACKAGE_NAME@.tests;
public class testTabHistory extends PixelTest {
@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
loadAndPaint(url);
loadAndPaint(url2);
loadAndPaint(url3);
// Get the device information and create the navigation for it
Device device = new Device();
Navigation nav = new Navigation(device);
mAsserter.dumpLog("device type: "+device.type);
mAsserter.dumpLog("device version: "+device.version);
mAsserter.dumpLog("device width: "+device.width);
mAsserter.dumpLog("device height: "+device.height);
// Go to the 2nd page
nav.back();
waitForText("Browser Blank Page 02");
verifyPageTitle("Browser Blank Page 02");
// Go to the first page
nav.back();
waitForText("Browser Blank Page 01");
verifyPageTitle("Browser Blank Page 01");
// Go forward to the second page
nav.forward();
waitForText("Browser Blank Page 02");
verifyPageTitle("Browser Blank Page 02");
// Reload page
nav.reload();
waitForText("Browser Blank Page 02");
verifyPageTitle("Browser Blank Page 02");
}
}