diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /browser/components/places/tests/browser/browser_bookmarkProperties_readOnlyRoot.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'browser/components/places/tests/browser/browser_bookmarkProperties_readOnlyRoot.js')
-rw-r--r-- | browser/components/places/tests/browser/browser_bookmarkProperties_readOnlyRoot.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/browser/components/places/tests/browser/browser_bookmarkProperties_readOnlyRoot.js b/browser/components/places/tests/browser/browser_bookmarkProperties_readOnlyRoot.js new file mode 100644 index 000000000..6f499888c --- /dev/null +++ b/browser/components/places/tests/browser/browser_bookmarkProperties_readOnlyRoot.js @@ -0,0 +1,42 @@ +"use strict" + +add_task(function* () { + info("Bug 479348 - Properties on a root should be read-only."); + + yield withSidebarTree("bookmarks", function* (tree) { + let itemId = PlacesUIUtils.leftPaneQueries["UnfiledBookmarks"]; + tree.selectItems([itemId]); + ok(tree.controller.isCommandEnabled("placesCmd_show:info"), + "'placesCmd_show:info' on current selected node is enabled"); + + yield withBookmarksDialog( + true, + function openDialog() { + tree.controller.doCommand("placesCmd_show:info"); + }, + function* test(dialogWin) { + // Check that the dialog is read-only. + ok(dialogWin.gEditItemOverlay.readOnly, "Dialog is read-only"); + // Check that accept button is disabled + let acceptButton = dialogWin.document.documentElement.getButton("accept"); + ok(acceptButton.disabled, "Accept button is disabled"); + + // Check that name picker is read only + let namepicker = dialogWin.document.getElementById("editBMPanel_namePicker"); + ok(namepicker.readOnly, "Name field is read-only"); + is(namepicker.value, + PlacesUtils.bookmarks.getItemTitle(PlacesUtils.unfiledBookmarksFolderId), + "Node title is correct"); + // Blur the field and ensure root's name has not been changed. + namepicker.blur(); + is(namepicker.value, + PlacesUtils.bookmarks.getItemTitle(PlacesUtils.unfiledBookmarksFolderId), + "Root title is correct"); + // Check the shortcut's title. + let bookmark = yield PlacesUtils.bookmarks.fetch(tree.selectedNode.bookmarkGuid); + is(bookmark.title, null, + "Shortcut title is null"); + } + ); + }); +}); |