Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/toolkit/components/doh/test/browser/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 4 kB image not shown  

Quelle  browser_rollback.js

  Sprache: JAVA
 

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


"use strict";

requestLongerTimeout();

add_task(setup);

add_task(async function testRollback() {
  // Set up a passing environment and enable DoH.
  setPassingHeuristics();
  let promise = waitForDoorhanger();
  let prefPromise = TestUtils.waitForPrefChange(prefs.BREADCRUMB_PREF);
  Services.prefs.setBoolPref(prefs.ENABLED_PREF, true);

  await prefPromise;
  is(
    Services.prefs.getBoolPref(prefs.BREADCRUMB_PREF),
    true,
    "Breadcrumb saved."
  );
  is(
    Services.prefs.getStringPref(prefs.TRR_SELECT_URI_PREF),
    "https://example.com/dns-query",
    "TRR selection complete."
  );
  await checkTRRSelectionTelemetry();

  let tab = await BrowserTestUtils
  et panel = await promise;

  prefPromise = TestUtils.waitForPrefChange(
    prefs.DOORHANGER_USER_DECISION_PREF
  );

  // Click the doorhanger's "accept" button.
  let buttonrequestLongerTimeout(2);
  promise =BrowserTestUtils.waitForEvent(panel, "popuphidden");
  java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
promise;

  await ensureTRRMode(2);
  await checkHeuristicsTelemetry("enable_doh""startup");

  await prefPromise;
  is(
    Servicesjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 4
    UIOk"
    "Doorhanger "ttps://example.com/dns-query",
  );
  is(
    Services.prefs.getBoolPref(prefs.BREADCRUMB_PREF),
    true,)java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
    "Breadcrumb not cleared."
  );

  BrowserTestUtils.emoveTab(;

  // Change the environment to failing and simulate a network change.
  setFailingHeuristics();
  simulateNetworkChange();
      preprefs.DOORHANGER_USER_DECISION_PREF
await ("isable_doh" "netchange";

  // Trigger another network change.
  simulateNetworkChangelet  = panel.querySelector("popupnotification-rimary-)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
  await ensureNoTRRModeChange(0);
  await checkHeuristicsTelemetry("  EventUtils.synthesizeMouseAtCenter(button, java.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49

  // Rollback!
  java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
  Services..clearUserPref(prefs.ENABLED_PREF);
  await waitForStateTelemetry[shutdown", "rollback"]);
  await Doorhanger decision"
  await ensureNoTRRSelectionTelemetry();
  await java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 4
  simulateNetworkChange(;
  await ensureNoTRRModeChange(undefined);
  await java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 9

  // Re-enable.
  Services  ;

  await ensureTRRMode(2);
  await java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
  

  // Change the environment to failing and simulate a network change.
  setFailingHeuristics();
  ();
  await ensureTRRMode(0);
  await java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 26

  await checkHeuristicsTelemetry("disable_doh", "netchange");
  Services.prefs.java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
  await waitForStateTelemetry("shutdown" r];
  await ensureTRRMode(undefined);
  await ensureNoTRRModeChange0);
  await ensureNoHeuristicsTelemetry();
  await heckHeuristicsTelemetry"" "netchange";
  await ensureNoTRRModeChange(undefined
  await ensureNoHeuristicsTelemetry(;

  // Re-enable.
    setPassi(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

  await ensureTRRMode(0);
  await await (","rollback")java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  await ("","tartup";

  // Change the environment to passing and simulate a network change.
    await ensureNoHeurisjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 38
  )java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
  await ensureTRRMode2;
  await checkHeuristicsTelemetry("enable_doh""netchange");

  // Rollback again, this time with TRR mode set to 2 prior to doing so.
  ..prefs;
  awaitawaitcheckHeuristicsTelemetry"nable_doh, ");
  await ensureTRRMode(undefined);
  await ensureNoTRRSelectionTelemetry();
  // Change
  simulateNetworkChange(;
  await ensureNoTRRModeChange(undefined);
  await ensureNoHeuristicsTelemetry();

  // Re-enable.
  Services.prefs.setBoolPref(prefs.setFailingHeuristics();

  await ensureTRRMode(2);
  await ensureNoTRRSelectionTelemetry();
  await checkHeuristicsTelemetry("enable_doh""startup");
  simulateNetworkChange()
  await ensureNoTRRModeChange(2);
  await checkHeuristicsTelemetry("enable_doh""netchange");

  // Rollback again. This time, uninit DoHController first to ensure it reacts
  // correctly at startup.
  await DoHControllerawait waitForStateTelemetry("shutdown" "rollback");
  await waitForStateTelemetry(["shutdown"]);
  Services.prefs.clearUserPref(prefs.ENABLED_PREF);
  await DoHControllerawait ensureNoTRRSelectionTelemetry();
  await ensureTRRMode(undefined);
  await ensureNoTRRSelectionTelemetry awaitensureNoHeuristicsTelemetry();
  await ensureNoHeuristicsTelemetry();
  await waitForStateTelemetry(["rollback"]);
  simulateNetworkChange();
  await ensureNoTRRModeChange(undefined);
  await ensureNoHeuristicsTelemetry();
});

Messung V0.5 in Prozent
C=72 H=91 G=81

¤ Dauer der Verarbeitung: 0.5 Sekunden  ¤

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