Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  test_SVG_switch_language_spoof.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/dom/svg/test/test_SVG_switch_language_spoof.html


<!DOCTYPE html>
<html>
  <!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1924087
-->

  <head>
    <title>Test for Bug 1924087</title>
    <script src="/tests/SimpleTest/SimpleTest.js"></script>
    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    <script class="testbody" type="application/javascript">
      SimpleTest.waitForExplicitFinish();

      function clearAndAddSVG() {
        document.getElementById("display").innerHTML = "";
        const template = document.querySelector("template");
        const clone = document.importNode(template.content, true);
        document.getElementById("display").appendChild(clone);
      }

      function getShownTexts() {
        const swtch = document.getElementById("switch");
        return [...swtch.children].filter(
          child => child.getBoundingClientRect().width > 0
        );
      }

      async function runTests() {
        await SpecialPowers.pushPrefEnv({
          set: [["intl.accept_languages""tr"]]
        });

        clearAndAddSVG();

        const shown = getShownTexts();
        is(shown.length, 1"Only one child should be selected");
        is(
          shown[0].textContent,
          "Merhaba!",
          "The selected child should be the one with the 'tr' language"
        );

        await SpecialPowers.pushPrefEnv({
          set: [
            ["privacy.resistFingerprinting", true],
            ["privacy.spoof_english"2],
          ],
        });

        clearAndAddSVG();

        const spoofedShown = getShownTexts();
        is(spoofedShown.length, 1"Only one child should be selected");
        is(
          spoofedShown[0].textContent,
          "Hello!",
          "The selected child should be the one with the 'en' language"
        );

        await SpecialPowers.popPrefEnv();
        await SpecialPowers.popPrefEnv();

        SimpleTest.finish();
      }
    </script>
  </head>
  <body onload="runTests()">
    <a
      target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=1924087"
      >Mozilla Bug 1924087</a
    >
    <template>
      <svg>
        <switch id="switch">
          <text systemLanguage="en">Hello!</text>
          <text systemLanguage="tr">Merhaba!</text>
        </switch>
      </svg>
    </template>
    <div id="display"></div>
  </body>
</html>

Messung V0.5 in Prozent
C=99 H=100 G=99

¤ Dauer der Verarbeitung: 0.4 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002