browser_sanitizeDialog.js File Reference

Go to the source code of this file.

Functions

function WindowHelper (aWin)
 
function addDownloadWithMinutesAgo (aMinutesAgo)
 
function addFormEntryWithMinutesAgo (aMinutesAgo)
 
function addHistoryWithMinutesAgo (aMinutesAgo)
 
function blankSlate ()
 
function boolPrefIs (aPrefName, aExpectedVal, aMsg)
 
function downloadExists (aID)
 
function doNextTest ()
 
function ensureDownloadsClearedState (aDownloadIDs, aShouldBeCleared)
 
function ensureFormEntriesClearedState (aFormEntries, aShouldBeCleared)
 
function ensureHistoryClearedState (aURIs, aShouldBeCleared)
 
function intPrefIs (aPrefName, aExpectedVal, aMsg)
 
function test ()
 

Variables

Cc["@mozilla.org/moz/jssubscript-loader;1"]
getService(Components.interfaces.mozIJSSubScriptLoader).loadSubScript("chrome
const 
winWatch
 
const dm
 
const bhist
 
const formhist
 
var gAllTests
 
var gDownloadId = 5555551
 
var gCurrTest = 0
 
var now_uSec = Date.now() * 1000
 
WindowHelper prototype
 

Function Documentation

function addDownloadWithMinutesAgo (   aMinutesAgo)

Adds a download to history.

Parameters
aMinutesAgoThe download will be downloaded this many minutes ago

Definition at line 642 of file browser_sanitizeDialog.js.

Here is the call graph for this function:

function addFormEntryWithMinutesAgo (   aMinutesAgo)

Adds a form entry to history.

Parameters
aMinutesAgoThe entry will be added this many minutes ago

Definition at line 684 of file browser_sanitizeDialog.js.

function addHistoryWithMinutesAgo (   aMinutesAgo)

Adds a history visit to history.

Parameters
aMinutesAgoThe visit will be visited this many minutes ago

Definition at line 705 of file browser_sanitizeDialog.js.

Here is the call graph for this function:

function blankSlate ( )

Removes all history visits, downloads, and form entries.

Definition at line 719 of file browser_sanitizeDialog.js.

Here is the caller graph for this function:

function boolPrefIs (   aPrefName,
  aExpectedVal,
  aMsg 
)

Ensures that the given pref is the expected value.

Parameters
aPrefNameThe pref's sub-branch under the privacy branch
aExpectedValThe pref's expected value
aMsgPassed to is()

Definition at line 735 of file browser_sanitizeDialog.js.

function doNextTest ( )

Runs the next test in the gAllTests array. If all tests have been run, finishes the entire suite.

Definition at line 764 of file browser_sanitizeDialog.js.

Here is the call graph for this function:

Here is the caller graph for this function:

function downloadExists (   aID)

Checks to see if the download with the specified ID exists.

Parameters
aIDThe ID of the download to check
Returns
True if the download exists, false otherwise

Definition at line 746 of file browser_sanitizeDialog.js.

Here is the caller graph for this function:

function ensureDownloadsClearedState (   aDownloadIDs,
  aShouldBeCleared 
)

Ensures that the specified downloads are either cleared or not.

Parameters
aDownloadIDsArray of download database IDs
aShouldBeClearedTrue if each download should be cleared, false otherwise

Definition at line 784 of file browser_sanitizeDialog.js.

Here is the call graph for this function:

function ensureFormEntriesClearedState (   aFormEntries,
  aShouldBeCleared 
)

Ensures that the specified form entries are either cleared or not.

Parameters
aFormEntriesArray of form entry names
aShouldBeClearedTrue if each form entry should be cleared, false otherwise

Definition at line 800 of file browser_sanitizeDialog.js.

function ensureHistoryClearedState (   aURIs,
  aShouldBeCleared 
)

Ensures that the specified URIs are either cleared or not.

Parameters
aURIsArray of page URIs
aShouldBeClearedTrue if each visit to the URI should be cleared, false otherwise

Definition at line 816 of file browser_sanitizeDialog.js.

function intPrefIs (   aPrefName,
  aExpectedVal,
  aMsg 
)

Ensures that the given pref is the expected value.

Parameters
aPrefNameThe pref's sub-branch under the privacy branch
aExpectedValThe pref's expected value
aMsgPassed to is()

Definition at line 834 of file browser_sanitizeDialog.js.

function test ( )

Definition at line 840 of file browser_sanitizeDialog.js.

Here is the call graph for this function:

function WindowHelper (   aWin)

This wraps the dialog and provides some convenience methods for interacting with it.

Parameters
aWinThe dialog's nsIDOMWindow

Definition at line 414 of file browser_sanitizeDialog.js.

Variable Documentation

const bhist
Initial value:
= Cc["@mozilla.org/browser/global-history;2"].
getService(Ci.nsIBrowserHistory)
const Cc
getService(Ci.sbIFaceplateManager)
const Ci

Definition at line 65 of file browser_sanitizeDialog.js.

const dm
Initial value:
= Cc["@mozilla.org/download-manager;1"].
getService(Ci.nsIDownloadManager)
const Cc
getService(Ci.sbIFaceplateManager)
const Ci

Definition at line 63 of file browser_sanitizeDialog.js.

const formhist
Initial value:
= Cc["@mozilla.org/satchel/form-history;1"].
getService(Ci.nsIFormHistory2)
const Cc
getService(Ci.sbIFaceplateManager)
const Ci

Definition at line 67 of file browser_sanitizeDialog.js.

var gAllTests

Definition at line 71 of file browser_sanitizeDialog.js.

var gCurrTest = 0

Definition at line 401 of file browser_sanitizeDialog.js.

var gDownloadId = 5555551

Definition at line 397 of file browser_sanitizeDialog.js.

var now_uSec = Date.now() * 1000

Definition at line 403 of file browser_sanitizeDialog.js.

WindowHelper prototype

Definition at line 418 of file browser_sanitizeDialog.js.

Cc ["@mozilla.org/moz/jssubscript-loader;1"] getService (Components.interfaces.mozIJSSubScriptLoader). loadSubScript("chrome const winWatch
Initial value:
= Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher)
const Cc
getService(Ci.sbIFaceplateManager)
const Ci

Tests the sanitize dialog (a.k.a. the clear recent history dialog). See bug 480169.

The purpose of this test is not to fully flex the sanitize timespan code; browser/base/content/test/browser_sanitize-timespans.js does that. This test checks the UI of the dialog and makes sure it's correctly connected to the sanitize timespan code.

Some of this code, especially the history creation parts, was taken from browser/base/content/test/browser_sanitize-timespans.js.

Definition at line 61 of file browser_sanitizeDialog.js.