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_longString.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/websocket/tests/test_websocket_longString.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 = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_basic""test");
is(ws.readyState, 0, "Initial readyState is 0");

const longString = new Array(1024*1024).join('123456789ABCDEF');

ws.onopen = function() {
  is(this, ws, "[onopen()] 'this' should point to the WebSocket.");
  ws.send(longString);
};

ws.onclose = function(e) {
  is(this, ws, "[onclose()] 'this' should point to the WebSocket.");
  ok(e.wasClean, "Connection closed cleanly");

  SimpleTest.executeSoon(SimpleTest.finish);
};

ws.onerror = function() {
  is(this, ws, "[onerror()] 'this' should point to the WebSocket.");
  ok(false, "onerror()] should not have been called!");
  SimpleTest.executeSoon(SimpleTest.finish);
};

ws.onmessage = function(e) {
  is(this, ws, "[onmessage()] 'this' should point to the WebSocket.");
  // Do not use |is(e.data, longString, "...");| that results in a _very_ long line.
  is(e.data.length, longString.length, "Length of received message");
  ok(e.data === longString, "Content of received message");
  this.close();
};

SimpleTest.waitForExplicitFinish();

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

Messung V0.5
C=95 H=97 G=95

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

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