Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quellcode-Bibliothek bug396519_window.xhtml   Sprache: unbekannt

 
Untersuchungsergebnis.xhtml Download desUnknown {[0] [0] [0]}

<?xml version="1.0"?>

<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<?xml-stylesheet href="chrome://global/skin" type="text/css"?>

<window id="396519Test"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        width="600"
        height="600"
        onload="runTest();"
        title="396519 test">

  <script src="chrome://mochikit/content/chrome-harness.js" />
  <script type="application/javascript" src="docshell_helpers.js" />
  <script type="application/javascript"><![CDATA[
    Services.prefs.setBoolPref("browser.navigation.requireUserInteraction", false);

    var gTestCount = 0;

    async function navigateAndTest(params, expected) {
      await promisePageNavigation(params);
      ++gTestCount;
      await doTest(expected);
    }

    async function doTest(expected) {
      function check(testCount, expected) {
        let history = this.browsingContext.sessionHistory;
        if (history.count == expected.length) {
          for (let i = 0; i < history.count; i++) {
            var shEntry = history.getEntryAtIndex(i).
                            QueryInterface(Ci.nsISHEntry);
            is(shEntry.isInBFCache, expected[i], `BFCache for shentry[${i}], test ${testCount}`);
          }

          // Make sure none of the SHEntries share bfcache entries with one
          // another.
          for (let i = 0; i < history.count; i++) {
            for (let j = 0; j < history.count; j++) {
              if (j == i)
                continue;

              let shentry1 = history.getEntryAtIndex(i)
                                    .QueryInterface(Ci.nsISHEntry);
              let shentry2 = history.getEntryAtIndex(j)
                                    .QueryInterface(Ci.nsISHEntry);
              ok(!shentry1.sharesDocumentWith(shentry2),
                 'Test ' + testCount + ': shentry[' + i + "] shouldn't " +
                 "share document with shentry[" + j + ']');
            }
          }
        }
        else {
          is(history.count, expected.length, "Wrong history length in test "+testCount);
        }
      }

      check.call(TestWindow.getBrowser(), gTestCount, expected);
    }

    async function runTest() {
      // Tests 1 + 2:
      //  Back/forward between two simple documents. Bfcache will be used.

      var test1Doc = "data:text/html,<html><head><title>test1</title></head>" +
                     "<body>test1</body></html>";

      await navigateAndTest({
        uri: test1Doc,
      }, [false]);

      var test2Doc = test1Doc.replace(/1/,"2");

      await navigateAndTest({
        uri: test2Doc,
      }, [true, false]);

      await navigateAndTest({
        uri: test1Doc,
      }, [true, true, false]);

      await navigateAndTest({
        uri: test2Doc,
      }, [true, true, true, false]);

      await navigateAndTest({
        uri: test1Doc,
      }, [false, true, true, true, false]);

      await navigateAndTest({
        uri: test2Doc,
      }, [false, false, true, true, true, false]);

      await navigateAndTest({
        back: true,
      }, [false, false, true, true, false, true]);

      await navigateAndTest({
        forward: true,
      }, [false, false, true, true, true, false]);

      await navigateAndTest({
        gotoIndex: 1,
      }, [false, false, true, true, true, false]);

      await navigateAndTest({
        back: true,
      }, [false, true, true, true, false, false]);

      await navigateAndTest({
        gotoIndex: 5,
      }, [false, false, true, true, false, false]);

      Services.prefs.clearUserPref("browser.navigation.requireUserInteraction");
      finish();
    }
  ]]></script>

  <browser type="content" primary="true" flex="1" id="content" remote="true" maychangeremoteness="true" />
</window>

[0.50Quellennavigators]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=752002