Eine aufbereitete Darstellung der Quelle

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


Quelle  test_dynamic_import.html  Sprache: HTML


 products/Sources/formale Sprachen/C/Firefox/dom/worklet/tests/test_dynamic_import.html


<!DOCTYPE HTML>
<html>
<head>
  <title>Test import() should throw a TypeError for Worklets</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <script type="application/javascript" src="common.js"></script>
</head>
<body>

<script type="application/javascript">
const WORKLET_SCRIPT = "dynamic_import.js";

function configureTest() {
  const ConsoleAPIStorage = SpecialPowers.Cc[
    "@mozilla.org/consoleAPI-storage;1"
  ].getService(SpecialPowers.Ci.nsIConsoleAPIStorage);

  // We use console API to check if a TypeError has been thrown, as worklets
  // have limitations to post the result back to the main document:
  // Worklets have a different global, and they don't have postMessage() APIs,
  // and static import SimpleTest.js in worklets also don'
t work.
  function observe(aSubject) {
    var obj = aSubject.wrappedJSObject;
    info("Got console message:" + obj.arguments[0]);
    is(TypeError.name + ": Success", obj.arguments[0], "import() should throw");

    ConsoleAPIStorage.removeLogEventListener(observe);
    SimpleTest.finish();
  }

  ConsoleAPIStorage.addLogEventListener(observe, SpecialPowers.wrap(document).nodePrincipal);
}

// This function is called into an iframe.
function runTestInIframe() {
  var audioContext = new AudioContext();
  audioContext.audioWorklet.addModule(WORKLET_SCRIPT);
}

</script>
</body>
</html>

Messung
CHZG
859810094

¤ Dauer der Verarbeitung: 0.45 Sekunden  ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,189,201
#Domains=946,203