50 desc:
"Bug 430148 - Remove or hide the more/less button in details pane...",
56 var
bhist = PlacesUtils.history.QueryInterface(
Ci.nsIBrowserHistory);
57 PlacesUtils.history.addVisit(PlacesUtils._uri(
TEST_URI), Date.now() * 1000,
58 null, PlacesUtils.history.TRANSITION_TYPED,
60 ok(bhist.isVisited(PlacesUtils._uri(
TEST_URI)),
"Visit has been added.");
63 PO.selectLeftPaneQuery(
"AllBookmarks");
64 isnot(PO._places.selectedNode,
null,
65 "Correctly selected all bookmarks node.");
67 ok(infoBoxExpanderWrapper.hidden,
68 "Expander button is hidden for all bookmarks node.");
72 PO.selectLeftPaneQuery(
"History");
73 isnot(PO._places.selectedNode,
null,
"Correctly selected history node.");
75 ok(infoBoxExpanderWrapper.hidden,
76 "Expander button is hidden for history node.");
80 var historyNode = PO._places.selectedNode.
82 historyNode.containerOpen =
true;
83 var childNode = historyNode.getChild(0);
84 isnot(childNode,
null,
"History node first child is not null.");
85 PO._places.selectNode(childNode);
87 ok(infoBoxExpanderWrapper.hidden,
88 "Expander button is hidden for history child node.");
92 var view = PO._content.treeBoxObject.view;
93 ok(view.rowCount > 0,
"History item exists.");
94 view.selection.select(0);
95 ok(infoBoxExpanderWrapper.hidden,
96 "Expander button is hidden for history item.");
99 historyNode.containerOpen =
false;
102 PO.selectLeftPaneQuery(
"BookmarksMenu");
103 isnot(PO._places.selectedNode,
null,
104 "Correctly selected bookmarks menu node.");
106 ok(infoBoxExpanderWrapper.hidden,
107 "Expander button is hidden for bookmarks menu node.");
111 var menuNode = PO._places.selectedNode.
113 menuNode.containerOpen =
true;
114 childNode = menuNode.getChild(0);
115 isnot(childNode,
null,
"Bookmarks menu child node exists.");
117 getString(
"recentlyBookmarkedTitle");
118 isnot(recentlyBookmarkedTitle,
null,
119 "Correctly got the recently bookmarked title locale string.");
120 is(childNode.title, recentlyBookmarkedTitle,
121 "Correctly selected recently bookmarked node.");
122 PO._places.selectNode(childNode);
124 ok(!infoBoxExpanderWrapper.hidden,
125 "Expander button is not hidden for recently bookmarked node.");
129 var view = PO._content.treeBoxObject.view;
130 ok(view.rowCount > 0,
"Bookmark item exists.");
131 view.selection.select(0);
133 ok(!infoBoxExpanderWrapper.hidden,
134 "Expander button is not hidden for bookmark item.");
139 ok(view.rowCount > 1,
"Second bookmark item exists.");
140 view.selection.select(1);
142 ok(!infoBoxExpanderWrapper.hidden,
143 "Expander button is not hidden for second bookmark item.");
147 menuNode.containerOpen =
false;
149 bhist.removeAllPages();
157 "Selected element in detailsDeck is infoBox.");
161 PO._additionalInfoFields.forEach(
function (
id) {
163 "Additional info field correctly collapsed: #" +
id);
168 ok(PO._additionalInfoFields.some(function (
id) {
170 }),
"Some additional info field correctly not collapsed");
174 ok(
true,
"Checking additional info fields visibiity for node: " +
nodeName);
178 PO._additionalInfoFields.forEach(
function (
id) {
180 "Additional info field correctly hidden by default: #" +
id);
184 expanderButton.click();
185 PO._additionalInfoFields.forEach(
function (
id) {
187 "Additional info field correctly unhidden after toggle: #" +
id);
189 expanderButton.click();
190 PO._additionalInfoFields.forEach(
function (
id) {
192 "Additional info field correctly hidden after toggle: #" +
id);
197 var elmt =
gLibrary.document.getElementById(
id);
198 isnot(elmt,
null,
"Correctly got element: #" +
id);
207 ok(
true,
"TEST: " + test.desc);
208 dump(
"TEST: " + test.desc +
"\n");
219 var
ww =
Cc[
"@mozilla.org/embedcomp/window-watcher;1"].
224 if (aTopic ===
"domwindowopened") {
225 ww.unregisterNotification(
this);
226 gLibrary = aSubject.QueryInterface(
Ci.nsIDOMWindow);
229 executeSoon(
function () {
239 dump(
"Starting test browser_library_infoBox.js\n");
242 ok(PlacesUtils,
"PlacesUtils is running in chrome context");
243 ok(
PlacesUIUtils,
"PlacesUIUtils is running in chrome context");
246 ww.registerNotification(windowObserver);
248 "chrome://browser/content/places/places.xul",
250 "chrome,toolbar=yes,dialog=no,resizable",
function checkAddInfoFields(PO, nodeName)
function checkAddInfoFieldsNotCollapsed(PO)
function getAndCheckElmtById(id)
sbOSDControlService prototype QueryInterface
getService(Ci.sbIFaceplateManager)
function checkInfoBoxSelected(PO)
function checkAddInfoFieldsCollapsed(PO)
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe