Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/browser/components/sessionstore/test/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  browser_423132.js   Sprache: JAVA

 
"use strict";

/**
 * Tests that cookies are stored and restored correctly
 * by sessionstore (bug 423132).
 */

add_task(async function () {
  const testURL =
    "http://mochi.test:8888/browser/" +
    "browser/components/sessionstore/test/browser_423132_sample.html";

  Services.cookies.removeAll();
  // make sure that sessionstore.js can be forced to be created by setting
  // the interval pref to 0
  await SpecialPowers.pushPrefEnv({
    set: [["browser.sessionstore.interval", 0]],
  });

  let tab = BrowserTestUtils.addTab(gBrowser, testURL);
  await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
  await TabStateFlusher.flush(tab.linkedBrowser);

  // get the sessionstore state for the window
  let state = ss.getBrowserState();

  // verify our cookie got set during pageload
  let i = 0;
  for (var cookie of Services.cookies.cookies) {
    i++;
  }
  Assert.equal(i, 1, "expected one cookie");

  // remove the cookie
  Services.cookies.removeAll();

  // restore the window state
  await setBrowserState(state);

  // at this point, the cookie should be restored...
  for (var cookie2 of Services.cookies.cookies) {
    if (cookie.name == cookie2.name) {
      break;
    }
  }
  is(cookie.name, cookie2.name, "cookie name successfully restored");
  is(cookie.value, cookie2.value, "cookie value successfully restored");
  is(cookie.path, cookie2.path, "cookie path successfully restored");

  // clean up
  Services.cookies.removeAll();
  BrowserTestUtils.removeTab(gBrowser.tabs[1]);
});

Messung V0.5
C=90 H=91 G=90

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

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