2013-02-01 06:39:49 -08:00
|
|
|
#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();
|
2013-02-22 19:42:46 -08:00
|
|
|
clearHistory();
|
2013-02-01 06:39:49 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
private void clearHistory() {
|
2013-05-08 13:46:36 -07:00
|
|
|
// Loading a page so we are sure that there is at least one history entry
|
2013-02-01 06:39:49 -08:00
|
|
|
String url = getAbsoluteUrl("/robocop/robocop_blank_01.html");
|
|
|
|
loadAndPaint(url);
|
|
|
|
|
2013-03-01 16:02:52 -08:00
|
|
|
// Checking that the history list is not empty
|
|
|
|
ListView hList = getHistoryList("Today|Yesterday");
|
2013-02-26 06:19:57 -08:00
|
|
|
mAsserter.ok(hList.getAdapter().getCount() > 0,"checking history exists","history exists");
|
2013-02-01 06:39:49 -08:00
|
|
|
|
|
|
|
// Quit the awesomescreen
|
|
|
|
mActions.sendSpecialKey(Actions.SpecialKey.BACK);
|
2013-02-27 07:21:24 -08:00
|
|
|
waitForText("Browser Blank Page 01");
|
2013-02-01 06:39:49 -08:00
|
|
|
|
|
|
|
// Clearing private data
|
2013-05-08 13:46:36 -07:00
|
|
|
selectSettingsItem("Privacy & Security", "Clear private data");
|
2013-02-01 06:39:49 -08:00
|
|
|
mAsserter.ok(mSolo.searchButton("Clear data"),"checking clear button","clear button exists");
|
|
|
|
mSolo.clickOnButton("Clear data");
|
2013-05-08 13:46:36 -07:00
|
|
|
// TODO: extra long wait here for bug 837274
|
|
|
|
mAsserter.is(mSolo.waitForText("Private data cleared", 0, 60000),true,"private data cleared successfully");
|
2013-02-01 06:39:49 -08:00
|
|
|
|
|
|
|
// Checking that history list is empty
|
2013-03-01 16:02:52 -08:00
|
|
|
hList = getHistoryList("History", 0);
|
|
|
|
mAsserter.ok(hList != null,"checking history is cleared ","history is cleared");
|
2013-02-01 06:39:49 -08:00
|
|
|
}
|
|
|
|
}
|