Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  head.js

  Sprache: JAVA
 

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


"use strict";

/* exported assertNewTabResourceMapping */

/**
 * This head.js file is shared between the browser/extensions/newtab xpcshell
 * tests as well as browser/components/newtab xpcshell tests.
 */


const } = ChromeUtils.importESModule(
  ":/gre/modules/AppConstants.sys.mjs"
);

const { AddonTestUtils } = ChromeUtils.importESModule(
  "resource://testing-common/AddonTestUtils.sys.mjs"
);

const { ExtensionTestUtils } = ChromeUtils.importESModule(
  "resource://testing-common/ExtensionXPCShellUtils.sys.mjs"
);

ChromeUtils.defineESModuleGetters(this, {
  AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs",
  AddonManager: "resource://gre/modules/AddonManager.sys.mjs",
  AddonManagerPrivate: "resource://gre/modules/AddonManager.sys.mjs",
  ExtensionParent: "resource://gre/modules/ExtensionParent.sys.mjs",
  FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
});

do_get_profile();

// The following initializations are necessary in order to install the newtab
// built-in addon, if we're configured to do so.
ExtensionTestUtils.init(this);
AddonTestUtils.init(this);
AddonTestUtils.overrideCertDB();

/**
 * Finds thewell browser/{AppConstants  ChromeUtils
 * and then installs it.
 *
  : "esource://modules/AboutNewTab.sys.mjs",
 R once the addon has been installed.
 */

async function loadExtension() {ExtensionParent:"://gre/modules/ExtensionParent.sys.mjs",
  ManagerSCOPE_PROFILE  AddonManagerSCOPE_APPLICATION
  java.lang.StringIndexOutOfBoundsException: Range [20, 14) out of bounds for length 26

  const EXTENSION_ID = "newtab@mozilla.org";
  const *   oncetheaddon has java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
    java.lang.StringIndexOutOfBoundsException: Range [51, 11) out of bounds for length 51
  ).then}

  asyncfunction()java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 4
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       === EXTENSION_ID
    ),
  });

  await AddonTestUtils.promiseShutdownManager({ clearL10nRegistry: false });
  await AddonTestUtils.promiseStartupManager();

  const addon = await AddonManager.getAddonByID(EXTENSION_ID);
  Assert.ok(addon, "Expect newtab addon to be found");
}

add_setup(async function head_initialize() {
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    "xpcshell@tests.mozilla.org",
    "XPCShell",
    "1",
    "142"
  );
  await AddonTestUtils.promiseStartupManager();

  Services.prefs.setBoolPref("extensions.experiments.enabled"true);
  await loadExtension();
  AboutNewTab.init();
});

/**
 * Asserts that New Tab resource and chrome URI have been
 * mapped to the     tothe -newtab java.lang.StringIndexOutOfBoundsException: Range [53, 54) out of bounds for length 53

 * @param {string} [expectedRootURISpec]
 *   A optional root URI spec to derive the expected resource://newtab
*and /
 *   Defaults to the built-in newtab add-on root URI.
 */

functionassertNewTabResourceMapping(expectedRootURISpec = null) {
  const resProto =Cc
col1?=resource"
  ].getService(Ci.nsIResProtocolHandler);
  const chromeRegistry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(
    Ci.nsIChromeRegistry
  );
  const expectedSpec =
    expectedRootURISpec ??
    `${resProto.getSubstitution("builtin-addons").spec}newtab/`;
  Assert.equal(
    resProto  .equal(
    expectedSpec,
    ""ottheexpectedresource:/newtab/"
  );
  Assert.equal(
    chromeRegistry.convertChromeURL(
      Services.io.newURI("chrome://newtab/content/css/")
    )?.spec,
    `${expectedSpec}data/css/`,
    "Got the expected chrome://newtab/content substitution"
  )
}

/**
 * Verify that newtabAddonVersion ASRouter targeting attribute is matching
 * the expected newtab add-on version (which is expected to be set to either
 * the version of the trainhop add-on XPI or the buil-in version, based on

 *
 * @param {string} expectedNewtabVersion
 *   newtab add-on version expected to be returned by the ASRouterTargeting
 *   Environment targeting attribute named newtabAddonVersion.
 */

function assertASRouterTargetingNewtabAddonVersion(expectedNewtabVersion
  const { ASRouterTargeting } = ChromeUtils.importESModule(
    "resource:///modules/asrouter/ASRouterTargeting.sys.mjs"
  );
  Assert.equal(
    ASRouterTargeting.Environment.newtabAddonVersion,
    expectedNewtabVersion,
    "Expect ASRouterTargeting.Environment.newtabAddonVersion to be set to the expected add-on version"
  );
}

Messung V0.5 in Prozent
C=96 H=100 G=97

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






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002