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


Quelle  test_simple_unknown_uris.js   Sprache: JAVA

 
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/*
 *  Test that default uri is bypassable by an unknown protocol that is
 *  present in the bypass list (and the pref is enabled)
 */

"use strict";

const {
  checkInputAndSerializationMatch,
  checkSerializationMissingSecondColon,
} = ChromeUtils.importESModule(
  "resource://testing-common/simple_unknown_uri_helpers.sys.mjs"
);

function inChildProcess() {
  return Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
}

function run_test() {
  // In-Parent-only process pref setup
  if (!inChildProcess()) {
    // child-test sets these in test_simple_unknown_uris_wrap.js
    Services.prefs.setBoolPref("network.url.useDefaultURI"true);
    Services.prefs.setBoolPref(
      "network.url.simple_uri_unknown_schemes_enabled",
      true
    );
    Services.prefs.setCharPref(
      "network.url.simple_uri_unknown_schemes",
      "simpleprotocol,otherproto"
    );
  }

  // sanity check: non-nested special url is fine
  checkInputAndSerializationMatch("https://example.com/");

  // nsStandardURL removes second colon when nesting protocols
  checkSerializationMissingSecondColon("https://https://example.com/");

  // no-bypass for unknown protocol uses defaultURI
  checkSerializationMissingSecondColon(
    "nonsimpleprotocol://https://example.com"
  );

  // an unknown protocol in the bypass list will use simpleURI
  checkInputAndSerializationMatch("simpleprotocol://https://example.com");

  // setCharPref not accessible from child process
  if (!inChildProcess()) {
    // check that pref update removes simpleprotocol from bypass list
    Services.prefs.setCharPref(
      "network.url.simple_uri_unknown_schemes",
      "otherproto"
    );
    checkSerializationMissingSecondColon(
      "simpleprotocol://https://example.com"
    );

    // check that spaces are parsed out
    Services.prefs.setCharPref(
      "network.url.simple_uri_unknown_schemes",
      " simpleprotocol , otherproto "
    );
    checkInputAndSerializationMatch("simpleprotocol://https://example.com");
    checkInputAndSerializationMatch("otherproto://https://example.com");
  }
}

Messung V0.5
C=91 H=97 G=93

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






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge