Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  test_no_find_showDialog.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/tests/mochitest/bugs/test_no_find_showDialog.html


<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Test for Bug 1348409</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <iframe src="about:blank"></iframe>
  <script type="text/javascript">

  async function checkForFindDialog() {
    let chromeScript = SpecialPowers.loadChromeScript(_ => {
      /* eslint-env mozilla/chrome-script */
      addMessageListener("test:check", () => {
        let sawFind = false;
        let findDialog = Services.wm.getMostRecentWindow("findInPage");
        if (findDialog) {
          findDialog.close();
          sawFind = true;
        }

        return sawFind;
      });

    });

    let sawFind = await chromeScript.sendQuery("test:check");
    chromeScript.destroy();
    return sawFind;
  }

  function ensureFinished(chromeScript) {
    return new Promise(resolve => {
      chromeScript.addMessageListener("test:disarm:done", (sawWindow) => {
        resolve(sawWindow);
      });
      chromeScript.sendAsyncMessage("test:disarm");
    });
  }

  function doWraparoundFind(findString, showDialog) {
    let result = window.find(findString,
                             false /* aCaseSensitive */,
                             false /* aBackwards*/,
                             true /* aWrapAround */,
                             false /* aWholeWord */,
                             false /* aSearchInFrames */,
                             showDialog /* aShowInDialog */)
    // Collapse selection so that we can do another find outside
    // of the selection result.
    document.getSelection().collapseToStart();
    return result;
  }

  function startTest() {
    add_task(async function() {
      ok(doWraparoundFind("text to search for", false),
         "Found the text in the document body.");

      // We're asking for the dialog now. We should just ignore that request.
      ok(doWraparoundFind("fhqwhgads", true),
         "Should return true and not show a dialog if the string exists in the page.");
      ok(!doWraparoundFind(null, true),
         "Should return false and not show a dialog if we pass a null string.");
      ok(!doWraparoundFind("", true),
         "Should return false and not show a dialog if we pass an empty string.");

      // Double check to ensure that the parent didn't open a find dialog
      let sawWindow = await checkForFindDialog();
      ok(!sawWindow, "Should never have seen the dialog.");
    });
  }
  </script>
</head>
<body onload="startTest()">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1348409">Mozilla Bug 1348409</a>

<p>
  Here's some text to search for: fhqwhgads! A hovercraft full of eels!
</p>

<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>

Messung V0.5
C=96 H=98 G=96

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© 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 und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge