Closed Bug 491269 Opened 15 years ago Closed 15 years ago

Test that editing folder name in bookmarks properties dialog does not accept the dialog

Categories

(Firefox :: Bookmarks & History, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 3.6a1

People

(Reporter: mak, Assigned: mak)

References

Details

Attachments

(1 file, 1 obsolete file)

we should add a test for this in browser_bookmarksProperties.js, noticed missing in bug 491221.
Blocks: 491221
Attached patch patch v1.0 (obsolete) — Splinter Review
this works upon patch in bug 422181 (i'll review it soon), since i need a places command to add a bookmark on an history page.
For this reason won't make 3.5, but would be cool to have this on 3.6 to test for changes in bug 491221.
Attachment #376089 - Flags: review?(adw)
Comment on attachment 376089 [details] [diff] [review]
patch v1.0

>+    var windowObserver = {
>+      observe: function(aSubject, aTopic, aData) {
>+        if (aTopic === "domwindowclosed") {
>+          ww.unregisterNotification(this);
>+          ok(self._cleanShutdown,
>+             "Dialog window should not be closed by editing a folder name in folder tree");

"Dialog window should not be closed by pressing Esc in folder name textbox..."

Looks good, but I'd like to run it here when bug 422181 is done.  Thanks for cleaning up the other parts in the file.
Attachment #376089 - Flags: review?(adw) → review+
Comment on attachment 376089 [details] [diff] [review]
patch v1.0

+    folderTree.addEventListener("DOMAttrModified", function onDOMAttrModified(event) {
+        if (event.attrName != "place")
+          return;
+        folderTree.removeEventListener("DOMAttrModified", arguments.callee, false);
+        executeSoon(function () {
+            // Create a new folder.
+            var newFolderButton = self.window.document.getElementById("editBMPanel_newFolderButton");
+            newFolderButton.doCommand();
+            ok(folderTree.hasAttribute("editing"),
+               "We are editing new folder name in folder tree");
+
+            // Press Escape to discard editing new folder name.
+            EventUtils.synthesizeKey("VK_ESCAPE", {}, self.window);
+            ok(!folderTree.hasAttribute("editing"),
+               "We have finished editing folder name in folder tree");
+            self._cleanShutdown = true;
+            self.window.document.documentElement.cancelDialog();
+          });
+      }, false);
+    foldersExpander.doCommand();
+  },

Too much indentation for both the addEventListener and executeSoon callbacks.  With that and the nit in comment 2, r=adw.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.6a1
Depends on: 422181
since bug 422181 can't make 1.9.1 (l10n changes), this can't make 1.9.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: