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

46 lines
1.5 KiB
Java

#filter substitution
package @ANDROID_PACKAGE_NAME@.tests;
import @ANDROID_PACKAGE_NAME@.*;
import android.widget.ListView;
public class testClearPrivateData extends PixelTest {
@Override
protected int getTestType() {
return TEST_MOCHITEST;
}
public void testClearPrivateData() {
blockForGeckoReady();
clearHistory();
}
private void clearHistory() {
// Loading a page so we are sure that there is at leats one history entry
String url = getAbsoluteUrl("/robocop/robocop_blank_01.html");
loadAndPaint(url);
// Checking that the history list is not empty
ListView hList = getHistoryList("Today|Yesterday");
mAsserter.ok(hList.getAdapter().getCount() > 0,"checking history exists","history exists");
// Quit the awesomescreen
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
waitForText("Browser Blank Page 01");
// Clearing private data
selectMenuItem("Settings");
if (waitForText("^Clear private data$")) {
mSolo.clickOnText("^Clear private data$");
}
mAsserter.ok(mSolo.searchButton("Clear data"),"checking clear button","clear button exists");
mSolo.clickOnButton("Clear data");
mAsserter.is(mSolo.waitForText("Private data cleared"),true,"private data cleared successfully");
// Checking that history list is empty
hList = getHistoryList("History", 0);
mAsserter.ok(hList != null,"checking history is cleared ","history is cleared");
}
}