Closed Bug 1706178 Opened 4 years ago Closed 4 years ago

Allow closing native popups from in-content tests

Categories

(Core :: Widget: Cocoa, defect)

defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: bugzilla, Unassigned)

References

Details

Some tests run in-content and synthesize the escape button to close context menus. One reason to do this is because they can't access the chrome-level popup to call hidePopup(). We should add a method that allows in-content tests to rollup native popups. mstange suggested something in DOMWindowUtils. I confirmed that the affected tests in accessible/tests can access DOMWindowUtils. I added a function here in the accessible test helper:

function closeContextMenu(aNodeOrID, aCheckerOrEventSeq) {
  this.__proto__ = new synthAction(aNodeOrID, aCheckerOrEventSeq);
  let DOMWindowUtils = this.DOMNode.ownerGlobal.windowUtils;
}

DOMWindowUtils is defined.

This would fix at least accessible/tests/mochitest/events/test_focus_contextmenu.xhtml (here) and accessible/tests/mochitest/events/test_focus_general.html (here).

(In reply to Harry Twyford [:harry] from comment #0)

This would fix at least accessible/tests/mochitest/events/test_focus_contextmenu.xhtml (here)

This test is disabled on macOS.

and accessible/tests/mochitest/events/test_focus_general.html (here).

This test checks other context menu related things that will not work with native context menus, so I think we can disable the relevant parts.

(In reply to Markus Stange [:mstange] from comment #1)

and accessible/tests/mochitest/events/test_focus_general.html (here).

This test checks other context menu related things that will not work with native context menus, so I think we can disable the relevant parts.

I've put a patch in bug 1706389.

This turned out to be unnecessary. Please reopen if a need for this comes up again.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.