summaryrefslogtreecommitdiffstats
path: root/browser/components/places/tests/browser/browser_bookmarkProperties_readOnlyRoot.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /browser/components/places/tests/browser/browser_bookmarkProperties_readOnlyRoot.js
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/places/tests/browser/browser_bookmarkProperties_readOnlyRoot.js')
-rw-r--r--browser/components/places/tests/browser/browser_bookmarkProperties_readOnlyRoot.js67
1 files changed, 67 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 0000000000..d98b7477ec
--- /dev/null
+++ b/browser/components/places/tests/browser/browser_bookmarkProperties_readOnlyRoot.js
@@ -0,0 +1,67 @@
+"use strict";
+
+add_task(async function test_dialog() {
+ info("Bug 479348 - Properties dialog on a root should be read-only.");
+ await withSidebarTree("bookmarks", async function (tree) {
+ tree.selectItems([PlacesUtils.bookmarks.unfiledGuid]);
+ Assert.ok(
+ !tree.controller.isCommandEnabled("placesCmd_show:info"),
+ "'placesCmd_show:info' on current selected node is disabled"
+ );
+
+ await withBookmarksDialog(
+ true,
+ function openDialog() {
+ // Even if the cmd is disabled, we can execute it regardless.
+ tree.controller.doCommand("placesCmd_show:info");
+ },
+ async function test(dialogWin) {
+ // Check that the dialog is read-only.
+ Assert.ok(dialogWin.gEditItemOverlay.readOnly, "Dialog is read-only");
+ // Check that accept button is disabled
+ let acceptButton = dialogWin.document
+ .getElementById("bookmarkpropertiesdialog")
+ .getButton("accept");
+ Assert.ok(acceptButton.disabled, "Accept button is disabled");
+
+ // Check that name picker is read only
+ let namepicker = dialogWin.document.getElementById(
+ "editBMPanel_namePicker"
+ );
+ Assert.ok(namepicker.readOnly, "Name field is read-only");
+ Assert.equal(
+ namepicker.value,
+ PlacesUtils.getString("OtherBookmarksFolderTitle"),
+ "Node title is correct"
+ );
+ }
+ );
+ });
+});
+
+add_task(async function test_library() {
+ info("Bug 479348 - Library info pane on a root should be read-only.");
+ let library = await promiseLibrary("UnfiledBookmarks");
+ registerCleanupFunction(async function () {
+ await promiseLibraryClosed(library);
+ });
+ let PlacesOrganizer = library.PlacesOrganizer;
+ let tree = PlacesOrganizer._places;
+ tree.focus();
+ Assert.ok(
+ !tree.controller.isCommandEnabled("placesCmd_show:info"),
+ "'placesCmd_show:info' on current selected node is disabled"
+ );
+
+ // Check that the pane is read-only.
+ Assert.ok(library.gEditItemOverlay.readOnly, "Info pane is read-only");
+
+ // Check that name picker is read only
+ let namepicker = library.document.getElementById("editBMPanel_namePicker");
+ Assert.ok(namepicker.readOnly, "Name field is read-only");
+ Assert.equal(
+ namepicker.value,
+ PlacesUtils.getString("OtherBookmarksFolderTitle"),
+ "Node title is correct"
+ );
+});