Closed Bug 1560010 Opened 5 years ago Closed 5 years ago

Investigate double alert601234 DOMModal

Categories

(Remote Protocol :: Marionette, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1560015

People

(Reporter: whimboo, Unassigned)

References

()

Details

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from bug 1487358 comment #22)

It looks like just spinning the event loop before checking for remaining alerts on the page after a prompt has been accepted/dismissed is not enough. Only when I add sleeps of about 30ms and more, a remaining prompt will be detected. Here is the HTML/JS snippet:

  <script type="text/javascript">
    function setInnerText(id, value) {
      document.getElementById(id).innerHTML = "<p>" + value + "</p>";
    }

    function handleTwoDialogs() {
      setInnerText("text1", prompt("First"));
      setInnerText("text2", prompt("Second"));
    }
  </script>
[..]
  <a href="#" id="open-two-dialogs" onclick="handleTwoDialogs()">Open two prompts.</a>

Olli, right now my code is waiting for the DOMModalDialogClosed event before it immediately checks for any remaining prompt via this method:
https://searchfox.org/mozilla-central/rev/9eb2f739c165b4e294929f7b99fbb4d90f8a396b/testing/marionette/modal.js#62

Maybe you know if there is some other kind of event Marionette would have to wait for before checking for remaining alerts? Or is the first prompt just blocking, and the second opens after the first has been closed? If that is the case maybe we need a sleep call for now until bug 1477977 has been fixed.

Not sure what I did here but that got accidentally filed and bug 1560015 is the right one.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
No longer depends on: 1487705
No longer depends on: 1477977
No longer blocks: 1457244, 1459118, 1479368
No longer depends on: 1487358
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.