browser_sanitizeDialog_treeView.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 downloadExists (aID)
 
function doNextTest ()
 
function ensureDownloadsClearedState (aDownloadIDs, aShouldBeCleared)
 
function ensureFormEntriesClearedState (aFormEntries, aShouldBeCleared)
 
function ensureHistoryClearedState (aURIs, aShouldBeCleared)
 
function openWindow (aOnloadCallback)
 
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 446 of file browser_sanitizeDialog_treeView.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 488 of file browser_sanitizeDialog_treeView.js.

function addHistoryWithMinutesAgo (   aMinutesAgo)

Adds a history visit to history.

Parameters
aMinutesAgoThe visit will be visited this many minutes ago

Definition at line 509 of file browser_sanitizeDialog_treeView.js.

Here is the call graph for this function:

function blankSlate ( )

Removes all history visits, downloads, and form entries.

Definition at line 523 of file browser_sanitizeDialog_treeView.js.

Here is the caller graph for this function:

function doNextTest ( )

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

Definition at line 554 of file browser_sanitizeDialog_treeView.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 536 of file browser_sanitizeDialog_treeView.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 574 of file browser_sanitizeDialog_treeView.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 590 of file browser_sanitizeDialog_treeView.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 606 of file browser_sanitizeDialog_treeView.js.

function openWindow (   aOnloadCallback)

Opens the sanitize dialog and runs a callback once it's finished loading.

Parameters
aOnloadCallbackA function that will be called once the dialog has loaded

Definition at line 620 of file browser_sanitizeDialog_treeView.js.

Here is the call graph for this function:

function test ( )

Definition at line 655 of file browser_sanitizeDialog_treeView.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.

A warning: Before you call any function that uses the tree (or any function that calls a function that uses the tree), you must set a non-everything duration by calling selectDuration(). The dialog does not initialize the tree if it does not yet need to be shown.

Parameters
aWinThe dialog's nsIDOMWindow

Definition at line 264 of file browser_sanitizeDialog_treeView.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 64 of file browser_sanitizeDialog_treeView.js.

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

Definition at line 62 of file browser_sanitizeDialog_treeView.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 66 of file browser_sanitizeDialog_treeView.js.

var gAllTests

Definition at line 70 of file browser_sanitizeDialog_treeView.js.

var gCurrTest = 0

Definition at line 246 of file browser_sanitizeDialog_treeView.js.

var gDownloadId = 5555551

Definition at line 242 of file browser_sanitizeDialog_treeView.js.

var now_uSec = Date.now() * 1000

Definition at line 248 of file browser_sanitizeDialog_treeView.js.

WindowHelper prototype

Definition at line 268 of file browser_sanitizeDialog_treeView.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 60 of file browser_sanitizeDialog_treeView.js.