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

Quelle  test_blob_channelname.js   Sprache: JAVA

 
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */


add_task(async function channelname() {
  var file = new File(
    [new Blob(["test"], { type: "text/plain" })],
    "test-name"
  );
  var url = URL.createObjectURL(file);
  var channel = NetUtil.newChannel({
    uri: url,
    loadUsingSystemPrincipal: true,
  });

  let inputStream = channel.open();
  ok(inputStream, "Should be able to open channel");
  ok(
    inputStream.QueryInterface(Ci.nsIAsyncInputStream),
    "Stream should support async operations"
  );

  await new Promise(resolve => {
    inputStream.asyncWait(
      () => {
        let available = inputStream.available();
        ok(available, "There should be data to read");
        Assert.equal(
          channel.contentDispositionFilename,
          "test-name",
          "filename matches"
        );
        resolve();
      },
      0,
      0,
      Services.tm.mainThread
    );
  });

  inputStream.close();
  channel.cancel(Cr.NS_ERROR_FAILURE);
});

Messung V0.5
C=94 H=100 G=96

¤ 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.