browser_library_left_pane_commands.js File Reference

Go to the source code of this file.

Functions

gTests push ({desc:"Bug 489351 - Date containers under History in Library cannot be deleted/cut", run:function(){var bhist=PlacesUtils.history.QueryInterface(Ci.nsIBrowserHistory);PlacesUtils.history.addVisit(PlacesUtils._uri(TEST_URI), Date.now()*1000, null, PlacesUtils.history.TRANSITION_TYPED, false, 0);ok(bhist.isVisited(PlacesUtils._uri(TEST_URI)),"Visit has been added");var PO=gLibrary.PlacesOrganizer;PO.selectLeftPaneQuery('History');isnot(PO._places.selectedNode, null,"We correctly selected History");ok(!PO._places.controller.isCommandEnabled("cmd_cut"),"Cut command is disabled");ok(!PO._places.controller.isCommandEnabled("cmd_delete"),"Delete command is disabled");var historyNode=PO._places.selectedNode.QueryInterface(Ci.nsINavHistoryContainerResultNode);historyNode.containerOpen=true;is(historyNode.childCount, 1,"History node has one child");var todayNode=historyNode.getChild(0);var todayNodeExpectedTitle=PlacesUtils.getString("finduri-AgeInDays-is-0");is(todayNode.title, todayNodeExpectedTitle,"History child is the expected container");PO._places.selectNode(todayNode);is(PO._places.selectedNode, todayNode,"We correctly selected Today container");ok(!PO._places.controller.isCommandEnabled("cmd_cut"),"Cut command is disabled");ok(PO._places.controller.isCommandEnabled("cmd_delete"),"Delete command is enabled");PO._places.controller.doCommand("cmd_delete");ok(!bhist.isVisited(PlacesUtils._uri(TEST_URI)),"Visit has been removed");is(historyNode.childCount, 0,"History node has no more children");historyNode.containerOpen=false;nextTest();}})
 
function nextTest ()
 
function test ()
 

Variables

const TEST_URI = "http://www.mozilla.org/"
 
var gTests = []
 
var gLibrary
 
var ww
 
var windowObserver
 

Function Documentation

function nextTest ( )

Definition at line 162 of file browser_library_left_pane_commands.js.

Here is the call graph for this function:

gTests push ( {desc:"Bug 489351 - Date containers under History in Library cannot be deleted/cut", run:function(){var bhist=PlacesUtils.history.QueryInterface(Ci.nsIBrowserHistory);PlacesUtils.history.addVisit(PlacesUtils._uri(TEST_URI), Date.now()*1000, null, PlacesUtils.history.TRANSITION_TYPED, false, 0);ok(bhist.isVisited(PlacesUtils._uri(TEST_URI)),"Visit has been added");var PO=gLibrary.PlacesOrganizer;PO.selectLeftPaneQuery('History');isnot(PO._places.selectedNode, null,"We correctly selected History");ok(!PO._places.controller.isCommandEnabled("cmd_cut"),"Cut command is disabled");ok(!PO._places.controller.isCommandEnabled("cmd_delete"),"Delete command is disabled");var historyNode=PO._places.selectedNode.QueryInterface(Ci.nsINavHistoryContainerResultNode);historyNode.containerOpen=true;is(historyNode.childCount, 1,"History node has one child");var todayNode=historyNode.getChild(0);var todayNodeExpectedTitle=PlacesUtils.getString("finduri-AgeInDays-is-0");is(todayNode.title, todayNodeExpectedTitle,"History child is the expected container");PO._places.selectNode(todayNode);is(PO._places.selectedNode, todayNode,"We correctly selected Today container");ok(!PO._places.controller.isCommandEnabled("cmd_cut"),"Cut command is disabled");ok(PO._places.controller.isCommandEnabled("cmd_delete"),"Delete command is enabled");PO._places.controller.doCommand("cmd_delete");ok(!bhist.isVisited(PlacesUtils._uri(TEST_URI)),"Visit has been removed");is(historyNode.childCount, 0,"History node has no more children");historyNode.containerOpen=false;nextTest();}}  )
function test ( )

Definition at line 195 of file browser_library_left_pane_commands.js.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

var gLibrary

Definition at line 46 of file browser_library_left_pane_commands.js.

var gTests = []

Definition at line 45 of file browser_library_left_pane_commands.js.

const TEST_URI = "http://www.mozilla.org/"

Test enabled commands in the left pane folder of the Library.

Definition at line 43 of file browser_library_left_pane_commands.js.

var windowObserver
Initial value:
= {
observe: function(aSubject, aTopic, aData) {
if (aTopic === "domwindowopened") {
ww.unregisterNotification(this);
gLibrary = aSubject.QueryInterface(Ci.nsIDOMWindow);
gLibrary.addEventListener("load", function onLoad(event) {
gLibrary.removeEventListener("load", onLoad, false);
executeSoon(function () {
});
}, false);
}
}
}
var event
Lastfm onLoad
Definition: mini.js:36
const Ci
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe

Definition at line 179 of file browser_library_left_pane_commands.js.

var ww
Initial value:
= Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher)
const Cc
getService(Ci.sbIFaceplateManager)
const Ci

Definition at line 176 of file browser_library_left_pane_commands.js.