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

Quelle  test_send-blob.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/dom/websocket/tests/websocket_hybi/test_send-blob.html


<!DOCTYPE html>
<html>
<head>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>

<p id="display">
</p>
<div id="content" style="display: none">
</div>
<pre id="test">

<script class="testbody" type="text/javascript">

function startsWith(target, prefix)
{
    return target.indexOf(prefix) === 0;
}

function distinctBytes()
{
    var array = [];
    for (var i = 0; i < 256; ++i)
        array[i] = i;
    // Concatenates chars into a single binary string
    return String.fromCharCode.apply(null, array);
}

var filesToCreate = [
  {name: "hellofile", data: "Hello, world!"},
  {name: "emptyfile"},
  {name: "allchars", data: distinctBytes()},
];

SpecialPowers.createFiles(filesToCreate, function (files) {
  var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/websocket_hybi/file_check-binary-messages");

  ws.onopen = function()
  {
      ws.send(files[0]);
      ws.send(files[1]);
      ws.send(files[2]);
  };

  ws.onmessage = function(event)
  {
      var message = event.data;
      if (startsWith(message, "PASS"))
          ok(true, message);
      else
          ok(false, message);
  };

  ws.onclose = function(event)
  {
    ok(event.wasClean, "should have closed cleanly");
    SimpleTest.finish();
  };
},
function (msg) {
  ok(false, "Failed to create files: " + msg);
  SimpleTest.finish();
});

SimpleTest.waitForExplicitFinish();

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

Messung V0.5
C=66 H=95 G=81

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