mobile/android/base/tests/testClearPrivateData.java.in
author Lucas Rocha <lucasr@mozilla.com>
Mon, 19 Aug 2013 21:33:49 +0100
changeset 143564 20273eaf47db49bdf84dbb1f2042c1e85035ddd4
parent 143527 0db3b6642ad006283ee1ba0075852303b105a759
child 144088 617b9050b5ed0d4c9d814038cbb99dd6f17e0099
permissions -rw-r--r--
Bug 905591 - Rename BaseTest's loadUrl to inputAndLoadUrl (r=gbrown)

#filter substitution
package @ANDROID_PACKAGE_NAME@.tests;

import @ANDROID_PACKAGE_NAME@.*;
import android.widget.ListView;

public class testClearPrivateData extends AboutHomeTest  {

    @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");
        inputAndLoadUrl(url);

        /*  Removed by Bug 896576 - [fig] Remove [getHistoryList] from BaseTest
        // 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", "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");
        */
    }
}