Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  test_wallpaper_protocol.js   Sprache: JAVA

 

"use strict";

// Need profile so that the protocol handler can resolve the path to the underlying file
do_get_profile();

function run_test() {
  // Check the protocol handler implements the correct interfaces
  let handler = Services.io.getProtocolHandler("moz-newtab-wallpaper");
  ok(
    handler instanceof Ci.nsIProtocolHandler,
    "moz-newtab-wallpaper handler provides nsIProtocolHandler interface"
  );
  ok(
    handler instanceof Ci.nsISubstitutingProtocolHandler,
    "moz-newtab-wallpaper handler provides nsISubstitutingProtocolHandler interface"
  );

  // Create a dummy loadinfo which we can hand to newChannel
  let dummyURI = Services.io.newURI("https://www.example.com/");
  let dummyChannel = NetUtil.newChannel({
    uri: dummyURI,
    loadUsingSystemPrincipal: true,
  });
  let dummyLoadInfo = dummyChannel.loadInfo;

  // Test that empty host fails
  let emptyHost = Services.io.newURI("moz-newtab-wallpaper://");
  Assert.throws(
    () => handler.newChannel(emptyHost, dummyLoadInfo),
    /NS_ERROR/i,
    "moz-newtab-wallpaper URI with empty host must not resolve"
  );

  // Test that valid host creates a channel (even if file doesn't exist yet)
  let validURI = Services.io.newURI("moz-newtab-wallpaper://wallpaper.jpg");
  let channel = handler.newChannel(validURI, dummyLoadInfo);
  ok(channel, "moz-newtab-wallpaper URI with valid host creates a channel");
}

Messung V0.5 in Prozent
C=79 H=67 G=72

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-09-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126438
#Domains=1867298