51 desc:
"Bug 489351 - Date containers under History in Library cannot be deleted/cut",
53 var
bhist = PlacesUtils.history.QueryInterface(
Ci.nsIBrowserHistory);
55 PlacesUtils.history.addVisit(PlacesUtils._uri(
TEST_URI), Date.now() * 1000,
56 null, PlacesUtils.history.TRANSITION_TYPED,
58 ok(bhist.isVisited(PlacesUtils._uri(
TEST_URI)),
"Visit has been added");
62 PO.selectLeftPaneQuery(
'History');
63 isnot(PO._places.selectedNode,
null,
"We correctly selected History");
66 ok(!PO._places.controller.isCommandEnabled(
"cmd_cut"),
67 "Cut command is disabled");
68 ok(!PO._places.controller.isCommandEnabled(
"cmd_delete"),
69 "Delete command is disabled");
70 var historyNode = PO._places.selectedNode
71 .QueryInterface(
Ci.nsINavHistoryContainerResultNode);
72 historyNode.containerOpen =
true;
75 is(historyNode.childCount, 1,
"History node has one child");
76 var todayNode = historyNode.getChild(0);
77 var todayNodeExpectedTitle = PlacesUtils.getString(
"finduri-AgeInDays-is-0");
78 is(todayNode.title, todayNodeExpectedTitle,
79 "History child is the expected container");
82 PO._places.selectNode(todayNode);
83 is(PO._places.selectedNode, todayNode,
84 "We correctly selected Today container");
86 ok(!PO._places.controller.isCommandEnabled(
"cmd_cut"),
87 "Cut command is disabled");
88 ok(PO._places.controller.isCommandEnabled(
"cmd_delete"),
89 "Delete command is enabled");
92 PO._places.controller.doCommand(
"cmd_delete");
93 ok(!bhist.isVisited(PlacesUtils._uri(
TEST_URI)),
"Visit has been removed");
96 is(historyNode.childCount, 0,
"History node has no more children");
98 historyNode.containerOpen =
false;
106 desc:
"Bug 490156 - Can't delete smart bookmark containers",
110 PO.selectLeftPaneQuery(
'BookmarksToolbar');
111 isnot(PO._places.selectedNode,
null,
"We have a valid selection");
112 is(PlacesUtils.getConcreteItemId(PO._places.selectedNode),
113 PlacesUtils.toolbarFolderId,
114 "We have correctly selected bookmarks toolbar node.");
117 ok(!PO._places.controller.isCommandEnabled(
"cmd_cut"),
118 "Cut command is disabled");
119 ok(!PO._places.controller.isCommandEnabled(
"cmd_delete"),
120 "Delete command is disabled");
122 var toolbarNode = PO._places.selectedNode
123 .QueryInterface(
Ci.nsINavHistoryContainerResultNode);
124 toolbarNode.containerOpen =
true;
127 PlacesUtils.bookmarks.insertBookmark(PlacesUtils.toolbarFolderId,
128 PlacesUtils._uri(
"place:sort=4"),
132 ok(toolbarNode.childCount > 0,
"Toolbar node has children");
133 var queryNode = toolbarNode.getChild(0);
134 is(queryNode.title,
"special_query",
"Query node is correctly selected");
137 PO._places.selectNode(queryNode);
138 is(PO._places.selectedNode, queryNode,
"We correctly selected query node");
141 ok(PO._places.controller.isCommandEnabled(
"cmd_cut"),
142 "Cut command is enabled");
143 ok(PO._places.controller.isCommandEnabled(
"cmd_delete"),
144 "Delete command is enabled");
147 PO._places.controller.doCommand(
"cmd_delete");
149 PlacesUtils.bookmarks.getFolderIdForItem(queryNode.itemId);
150 ok(
false,
"Unable to remove query node bookmark");
152 ok(
true,
"Query node bookmark has been correctly removed");
155 toolbarNode.containerOpen =
false;
165 info(
"Start of test: " + test.desc);
176 var
ww =
Cc[
"@mozilla.org/embedcomp/window-watcher;1"].
181 if (aTopic ===
"domwindowopened") {
182 ww.unregisterNotification(
this);
183 gLibrary = aSubject.QueryInterface(
Ci.nsIDOMWindow);
186 executeSoon(
function () {
198 ok(PlacesUtils,
"PlacesUtils is running in chrome context");
199 ok(
PlacesUIUtils,
"PlacesUIUtils is running in chrome context");
202 ww.registerNotification(windowObserver);
204 "chrome://browser/content/places/places.xul",
206 "chrome,toolbar=yes,dialog=no,resizable",
getService(Ci.sbIFaceplateManager)
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe