#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 least 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 selectSettingsItem("Privacy & Security", "Clear private data"); mAsserter.ok(mSolo.searchButton("Clear data"),"checking clear button","clear button exists"); mSolo.clickOnButton("Clear data"); // TODO: extra long wait here for bug 837274 mAsserter.is(mSolo.waitForText("Private data cleared", 0, 60000),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"); } }