Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/devtools/client/framework/test/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  browser_toolbox_zoom.js

  Sprache: JAVA
 

/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */


"use strict";

const { Toolbox } = require("resource://devtools/client/framework/toolbox.js");
const L10N = new LocalizationHelper(
  "devtools/client/locales/toolbox.properties"
);

add_task(async function () {
  registerCleanupFunction(function () {
    Services.prefs.clearUserPref("devtools.toolbox.zoomValue");
  });

  // This test assume that zoom value will be default value. i.e. x1.0.
  Services.prefs.setCharPref("devtools.toolbox.zoomValue""1.0");
  await addTab("about:blank");
  const toolbox = await gDevTools.showToolboxForTab(gBrowser.selectedTab, {
    toolId: "styleeditor",
    hostType: Toolbox.HostType.BOTTOM,
  });

  info("testing zoom keys");

  testZoomLevel("In"21.2, toolbox);
  testZoomLevel("Out"30.9, toolbox);
  testZoomLevel("Reset"11, toolbox);

  await toolbox.destroy();
  gBrowser.removeCurrentTab();
});

function testZoomLevel(type, times, expected, toolbox) {
  sendZoomKey("toolbox.zoom" + type + ".key", times);

  const zoom = getCurrentZoom(toolbox);
  is(
    zoom.toFixed(1),
    expected.toFixed(1),
    "zoom level correct after zoom " + type
  );

  const savedZoom = parseFloat(
    Services.prefs.getCharPref("devtools.toolbox.zoomValue")
  );
  is(
    savedZoom.toFixed(1),
    expected.toFixed(1),
    "saved zoom level is correct after zoom " + type
  );
}

function sendZoomKey(shortcut, times) {
  for (let i = 0; i < times; i++) {
    synthesizeKeyShortcut(L10N.getStr(shortcut));
  }
}

function getCurrentZoom(toolbox) {
  return toolbox.win.browsingContext.fullZoom;
}

Messung V0.5 in Prozent
C=91 H=95 G=92

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-06-07) ¤

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