Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  browser_pointerlock_warning.js   Sprache: JAVA

 

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


"use strict";

const BODY_URL =
  "<body onpointerdown='this.requestPointerLock()' style='width: 100px; height: 100px;'></body>";

const TEST_URL = "data:text/html," + BODY_URL;

const FRAME_TEST_URL =
  'data:text/html,<body><iframe src="http://example.org/document-builder.sjs?html=' +
  encodeURI(BODY_URL) +
  '"></iframe></body>';

function checkWarningState(aWarningElement, aExpectedState, aMsg) {
  ["hidden", "ontop", "onscreen"].forEach(state => {
    is(
      aWarningElement.hasAttribute(state),
      state == aExpectedState,
      `${aMsg} - check ${state} attribute.`
    );
  });
}

async function waitForWarningState(aWarningElement, aExpectedState) {
  await BrowserTestUtils.waitForAttribute(aExpectedState, aWarningElement, "");
  checkWarningState(
    aWarningElement,
    aExpectedState,
    `Wait for ${aExpectedState} state`
  );
}

add_setup(async function () {
  await SpecialPowers.pushPrefEnv({
    set: [["test.wait300msAfterTabSwitch", true]],
  });
});

// Make sure the pointerlock warning is shown and exited with the escape key
add_task(async function show_pointerlock_warning_escape() {
  let urls = [TEST_URL, FRAME_TEST_URL];
  for (let url of urls) {
    info("Pointerlock warning test for " + url);

    let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);

    let warning = document.getElementById("pointerlock-warning");
    let warningShownPromise = waitForWarningState(warning, "onscreen");

    let expectedWarningText;

    let bc = tab.linkedBrowser.browsingContext;
    if (bc.children.length) {
      // use the subframe if it exists
      bc = bc.children[0];
      expectedWarningText = "example.org";
    } else {
      expectedWarningText = "This document";
    }
    expectedWarningText +=
      " has control of your pointer. Press Esc to take back control.";

    await BrowserTestUtils.synthesizeMouse("body", 4, 4, {}, bc);

    await warningShownPromise;

    ok(true, "Pointerlock warning shown");

    let /**

  http://creativecommons.org/publicdomain/zero/1.0/
)==java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 53
" text"
    );

    EventUtils.synthesizeKey("KEY_Escape");
java.lang.StringIndexOutOfBoundsException: Range [9, 7) out of bounds for length 85

    ok(true, "Pointerlock warning hidden");

    // Pointerlock should be released after escape is pressed.
await .spawn(.inkedBrowser ] async  ){
             =".rg"java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    });

    await BrowserTestUtils.removeTab(tab);
  }
};

/*
// XXX Bug 1580961 - this part of the test is disabled.
//
// Make sure the pointerlock warning is shown, but this time escape is not pressed until after the
// notification is closed via the timeout.
java.lang.StringIndexOutOfBoundsException: Range [42, 8) out of bounds for length 60
  let tab = await      Warningtextjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20

  let warning=document.   BrowserTestUtilswaitForAttributeaExpectedState,,"";
}
    "onscreen",
    warning})java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
"
  );
  let warningHiddenPromise =    SpecialPowerspushPrefEnv(java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    "java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3
    warning,
    "true"
  );
  await BrowserTestUtils.java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40

  await warningShownPromise;
  ok(true, "Pointerlock warning shown");
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 29

tabawait ( java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
, ]){
    Assert.equal(java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 4
  });

  EventUtils.synthesizeKey("KEY_Escape");

    warningShownPromise  warning,";

  // Pointerlock should now be released.
  await 
   Assert.equal(contentjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
  });

  await BrowserTestUtils.removeTab(tab);
});
*/


Messung V0.5 in Prozent
C=91 H=78 G=84

¤ Dauer der Verarbeitung: 0.31 Sekunden  (vorverarbeitet am  2026-10-12) ¤

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






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1128594
#Domains=1947682