Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/dom/websocket/tests/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  test_websocket_bigBlob.html   Sprache: HTML

 
 products/sources/formale Sprachen/C/Firefox/dom/websocket/tests/test_websocket_bigBlob.html


<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"></meta>
  <title>WebSocket test - big blob on content side</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="text/javascript" src="websocket_helpers.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script class="testbody" type="text/javascript">

var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_bigBlob");
is(ws.readyState, 0, "Initial readyState is 0");
ws.binaryType = "blob";

ws.onopen = function() {
  is(ws.readyState, 1, "Open readyState is 1");
  ws.send(new Blob([new Array(1024*1024).join('123456789ABCDEF')]));
}

let receivedBlob;
ws.onmessage = function(e) {
  ok(e.data instanceof Blob, "We should be receiving a Blob");
  receivedBlob = e.data;
  ws.close();
}

ws.onclose = function() {
  is(ws.readyState, 3, "Close readyState is 3");

  // check blob contents
  var reader = new FileReader();
  reader.onload = function() {
    is(reader.result, new Array(1024*1024).join('123456789ABCDEF'), "All data matches");
  }

  reader.onerror = function() {
    ok(false, "Something bad happen.");
  }

  reader.onloadend = function() {
    SimpleTest.finish();
  }

  reader.readAsBinaryString(receivedBlob);
}

SimpleTest.requestFlakyTimeout("The web socket tests are really fragile, but avoiding timeouts might be hard, since it's testing stuff on the network. " +
                               "Expect all sorts of flakiness in this test...");
SimpleTest.waitForExplicitFinish();

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

Messung V0.5
C=98 H=81 G=89

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.