Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/toolkit/content/tests/browser/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  browser_bug982298.js

  Sprache: JAVA
 

const scrollHtml =
  '<textarea id="textarea1" row=2>Firefox\n\nFirefox\n\n\n\n\n\n\n\n\n\n' +
  '</textarea><a href="about:blank">blank</a>';

add_task(async function () {
  let url = "data:text/html;base64," + btoa(scrollHtml);
  await BrowserTestUtils.withNewTab(
    { gBrowser, url },
    async function (browser) {
      let awaitFindResult = new Promise(resolve => {
        let listener = {
          onFindResult(aData) {
            info("got find result");
            browser.finder.removeResultListener(listener);

            Assert.equal(
              aData.result,
              Ci.nsITypeAheadFind.FIND_FOUND,
              "should find string"
            );
            resolve();
          },
          onCurrentSelection() {},
          onMatchesCountResult() {},
        };
        info(
          "about to add results listener, open find bar, and send 'F' string"
        );
        browser.finder.addResultListener(listener);
      });
      await gFindBarPromise;
      gFindBar.onFindCommand();
      EventUtils.sendString("F");
      info("added result listener and sent string 'F'");
      await awaitFindResult;

      // scroll textarea to bottom
      await SpecialPowers.spawn(browser, [], () => {
        let textarea = content.document.getElementById("textarea1");
        textarea.scrollTop = textarea.scrollHeight;
      });
      BrowserTestUtils.startLoadingURIString(browser, "about:blank");
      await BrowserTestUtils.browserLoaded(browser, {
        wantLoad: "about:blank",
      });

      Assert.equal(
        browser.currentURI.spec,
        "about:blank",
        "got load event for about:blank"
      );

      let awaitFindResult2 = new Promise(resolve => {
        let listener = {
          onFindResult() {
            info("got find result #2");
            browser.finder.removeResultListener(listener);
            resolve();
          },
          onCurrentSelection() {},
          onMatchesCountResult() {},
        };

        browser.finder.addResultListener(listener);
        info("added result listener");
      });
      // find again needs delay for crash test
      setTimeout(function () {
        // ignore exception if occured
        try {
          info("about to send find again command");
          gFindBar.onFindAgainCommand(false);
          info("sent find again command");
        } catch (e) {
          info("got exception from onFindAgainCommand: " + e);
        }
      }, 0);
      await awaitFindResult2;
    }
  );
});

Messung V0.5 in Prozent
C=92 H=96 G=93

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-08-26) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.