Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  browser_prefs.js

  Sprache: JAVA
 

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


"use strict";

const { ExperimentAPI } = ChromeUtils.importESModule(
  "resource://nimbus/ExperimentAPI.sys.mjs"
);
const { ExperimentFakes } = ChromeUtils.importESModule(
  "resource://testing-common/NimbusTestUtils.sys.mjs"
);
const { ExperimentManager } = ChromeUtils.importESModule(
  "resource://nimbus/lib/ExperimentManager.sys.mjs"
);

const EXPERIMENT_VALUE = "experiment-value";
const ROLLOUT_VALUE = "rollout-value";
const ROLLOUT = "rollout";
const EXPERIMENT = "experiment";

const VALUES = {
  [ROLLOUT]: ROLLOUT_VALUE,
  [EXPERIMENT]: EXPERIMENT_VALUE,
};

add_task(async function test_prefs_priority() {
  const pref = "nimbus.testing.testSetString";
  const featureId = "testFeature";

  async function doTest({ settingEnrollments, expectedValue }) {
    info(
      `Enrolling in a rollout and experiment where the ${settingEnrollments.join(
        " and "
      )} set the same pref variable.`
    );
    const enrollmentCleanup = [];

    for (const enrollmentKind of [ROLLOUT, EXPERIMENT]) {
      const config = {
        featureId,
        value: {},
      };

      if (settingEnrollments.includes(enrollmentKind)) {
        config.value.testSetString = VALUES[enrollmentKind];
      }

      enrollmentCleanup.push(
        await ExperimentFakes.enrollWithFeatureConfig(config, {
          isRollout: enrollmentKind === ROLLOUT,
        })
      );
    }

    is(
      NimbusFeatures[featureId].getVariable("testSetString"),
      expectedValue,
      "Expected the variable to match the expected value"
    );

    is(
      Services.prefs.getStringPref(pref),
      expectedValue,
      "Expected the pref to match the expected value"
    );

    for (const cleanup of enrollmentCleanup) {
      cleanup();
    }

    Services.prefs.deleteBranch(pref);
  }

  for (const settingEnrollments of [
    [ROLLOUT],
    [EXPERIMENT],
    [ROLLOUT, EXPERIMENT],
  ]) {
    const expectedValue = settingEnrollments.includes(EXPERIMENT)
      ? EXPERIMENT_VALUE
      : ROLLOUT_VALUE;

    await doTest({ settingEnrollments, expectedValue });
  }
});

Messung V0.5 in Prozent
C=96 H=95 G=95

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet am  2026-06-05) ¤

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

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik