Eine aufbereitete Darstellung der Quelle

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


Impressum browser_bug1316330.js  Sprache: JAVA


const URL =
  "data:text/html,<script>" +
  "window.focus();" +
  "var down = 0; var press = 0;" +
  "onkeydown = function(e) {" +
  "  var startTime = Date.now();" +
  "  document.body.setAttribute('data-down', ++down);" +
  "  if (e.keyCode == KeyboardEvent.DOM_VK_D) while (Date.now() - startTime < 500) {}" +
  "};" +
  "onkeypress = function(e) {" +
  "  var startTime = Date.now();" +
  "  document.body.setAttribute('data-press', ++press);" +
  "  if (e.charCode == 'p'.charCodeAt(0)) while (Date.now() - startTime < 500) {}" +
  "};" +
  "</script>";

add_task(async function () {
  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
  let browser = tab.linkedBrowser;

  await EventUtils.synthesizeAndWaitKey("d", { repeat: 3 });

  await SpecialPowers.spawn(browser, [], async function () {
    is(
      content.document.body.getAttribute("data-down"),
      "2",
      "Correct number of events"
    );
    is(
      content.document.body.getAttribute("data-press"),
      "2",
      "Correct number of events"
    );
  });

  await EventUtils.synthesizeAndWaitKey("p", { repeat: 3 });

  await SpecialPowers.spawn(browser, [], async function () {
    is(
      content.document.body.getAttribute("data-down"),
      "4",
      "Correct number of events"
    );
    is(
      content.document.body.getAttribute("data-press"),
      "4",
      "Correct number of events"
    );
  });

  gBrowser.removeCurrentTab();
});

Messung
CHZG
1009910099

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-25) ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,189,103
#Domains=945,637