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

Quelle  browser_keypressTelemetry.js

  Sprache: JAVA
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


var EventUtils = {};
var PaintListener = {};
Services.scriptloader.loadSubScript(
  "chrome://mochikit/content/tests/SimpleTest/EventUtils.js",
  EventUtils
);

const { ContentTaskUtils } = ChromeUtils.importESModule(
  "resource://testing-common/ContentTaskUtils.sys.mjs"
);

async function getRecordedKeypressCount() {
  await Services.fog.testFlushAllChildren();
  const v = Glean.performanceInteraction.keypressPresentLatency.testGetValue();
  return v ? v.count : 0;
}

add_task(async function () {
  await SpecialPowers.pushPrefEnv({
    set: [["toolkit.telemetry.ipcBatchTimeout"10]],
  });
  Services.fog.testResetFOG();

  waitForExplicitFinish();

  gURLBar.focus();
  await SimpleTest.promiseFocus(window);
  EventUtils.sendChar("x");

  await ContentTaskUtils.waitForCondition(
    async () => {
      return (await getRecordedKeypressCount()) > 0;
    },
    "waiting for telemetry",
    200,
    600
  );
  let result = await getRecordedKeypressCount();
  Assert.equal(result, 1"One keypress recorded");

  gURLBar.focus();
  await SimpleTest.promiseFocus(window);
  EventUtils.sendChar("x");

  await ContentTaskUtils.waitForCondition(
    async () => {
      return (await getRecordedKeypressCount()) > 1;
    },
    "waiting for telemetry",
    200,
    600
  );
  result = await getRecordedKeypressCount();
  Assert.equal(result, 2"Two keypresses recorded");
});

Messung V0.5 in Prozent
C=89 H=90 G=89

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© 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.