Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/editor/libeditor/tests/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  test_bug569988.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/editor/libeditor/tests/test_bug569988.html


<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=569988
-->

<head>
  <title>Test for Bug 569988</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="/tests/SimpleTest/EventUtils.js"></script>
  <link rel="stylesheet" href="/tests/SimpleTest/test.css">
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=569988">Mozilla Bug 569988</a>
<p id="display"></p>
<div id="content" style="display: none">

</div>
<pre id="test">
<script type="application/javascript">

/** Test for Bug 569988 **/

SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(runTest);


function runTest() {
  var script = SpecialPowers.loadChromeScript(function() {
    /* eslint-env mozilla/chrome-script */
    var gPromptInput = null;
    var os = Services.obs;

    os.addObserver(onPromptLoad, "common-dialog-loaded");

    function onPromptLoad(subject) {
      let ui = subject.Dialog.ui;
      sendAsyncMessage("ok", [true, "onPromptLoad is called"]);
      gPromptInput = ui.loginTextbox;
      gPromptInput.addEventListener("focus", onPromptFocus);
      // shift focus to ensure it fires.
      ui.button0.focus();
      gPromptInput.focus();
    }

    function onPromptFocus() {
      sendAsyncMessage("ok", [true, "onPromptFocus is called"]);
      gPromptInput.removeEventListener("focus", onPromptFocus);

      var listener = {
        handleEvent: function _hv(aEvent) {
          var isPrevented = aEvent.defaultPrevented;
          sendAsyncMessage("ok", [!isPrevented,
                           "ESC key event is prevented by editor"]);
          gPromptInput.removeEventListener("keypress", listener, { mozSystemGroup: true });
        },
      };
      gPromptInput.addEventListener("keypress", listener, { mozSystemGroup: true });

      sendAsyncMessage("info""sending key");
      var EventUtils = {};
      EventUtils.window = {};
      EventUtils._EU_Ci = Ci;
      EventUtils._EU_Cc = Cc;
      Services.scriptloader
        .loadSubScript("chrome://mochikit/content/tests/SimpleTest/EventUtils.js",
                       EventUtils);
      EventUtils.synthesizeKey("VK_ESCAPE", {},
                               gPromptInput.ownerGlobal);
    }

    addMessageListener("destroy", function() {
      os.removeObserver(onPromptLoad, "common-dialog-loaded");
    });
  });
  script.addMessageListener("ok", ([val, msg]) => ok(val, msg));
  script.addMessageListener("info", msg => info(msg));

  info("opening prompt...");
  prompt("summary""text");
  info("prompt is closed");

  script.sendAsyncMessage("destroy");

  SimpleTest.finish();
}

</script>
</pre>
</body>
</html>

100%


¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.