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


Quelle  browser_bug1347823.js   Sprache: JAVA

 
/**
 * Test that session history's expiration tracker would remove bfcache on
 * expiration.
 */


// With bfcache not expired.
add_task(async function testValidCache() {
  // Make an unrealistic large timeout.
  await SpecialPowers.pushPrefEnv({
    set: [
      ["browser.sessionhistory.contentViewerTimeout", 86400],
      // If Fission is disabled, the pref is no-op.
      ["fission.bfcacheInParent"true],
    ],
  });

  await BrowserTestUtils.withNewTab(
    { gBrowser, url: "data:text/html;charset=utf-8,pageA1" },
    async function (browser) {
      // Make a simple modification for bfcache testing.
      await SpecialPowers.spawn(browser, [], () => {
        content.document.body.textContent = "modified";
      });

      // Load a random page.
      BrowserTestUtils.startLoadingURIString(
        browser,
        "data:text/html;charset=utf-8,pageA2"
      );
      await BrowserTestUtils.browserLoaded(browser);

      // Go back and verify text content.
      let awaitPageShow = BrowserTestUtils.waitForContentEvent(
        browser,
        "pageshow"
      );
      browser.goBack();
      await awaitPageShow;
      await SpecialPowers.spawn(browser, [], () => {
        is(content.document.body.textContent, "modified");
      });
    }
  );
});

// With bfcache expired.
add_task(async function testExpiredCache() {
  // Make bfcache timeout in 1 sec.
  await SpecialPowers.pushPrefEnv({
    set: [
      ["browser.sessionhistory.contentViewerTimeout", 1],
      // If Fission is disabled, the pref is no-op.
      ["fission.bfcacheInParent"true],
    ],
  });

  await BrowserTestUtils.withNewTab(
    { gBrowser, url: "data:text/html;charset=utf-8,pageB1" },
    async function (browser) {
      // Make a simple modification for bfcache testing.
      await SpecialPowers.spawn(browser, [], () => {
        content.document.body.textContent = "modified";
      });

      // Load a random page.
      BrowserTestUtils.startLoadingURIString(
        browser,
        "data:text/html;charset=utf-8,pageB2"
      );
      await BrowserTestUtils.browserLoaded(browser);

      // Wait for 3 times of expiration timeout, hopefully it's evicted...
      await SpecialPowers.spawn(browser, [], () => {
        return new Promise(resolve => {
          content.setTimeout(resolve, 5000);
        });
      });

      // Go back and verify text content.
      let awaitPageShow = BrowserTestUtils.waitForContentEvent(
        browser,
        "pageshow"
      );
      browser.goBack();
      await awaitPageShow;
      await SpecialPowers.spawn(browser, [], () => {
        is(content.document.body.textContent, "pageB1");
      });
    }
  );
});

Messung V0.5
C=92 H=99 G=95

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






                                                                                                                                                                                                                                                                                                                                                                                                     


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