Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/base/test/chrome/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

SSL test_bug120684.xhtml   Sprache: HTML

 

<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=120684
-->

<window title="Mozilla Bug 120684"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>

  <!-- test results are displayed in the html:body -->
  <body xmlns="http://www.w3.org/1999/xhtml">
  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=120684"
     target="_blank">Mozilla Bug 120684</a>
  </body>

  <!-- test code goes here -->
  <script type="application/javascript">
  <![CDATA[
  /** Test for Bug 120684 */

  var list = new ChromeNodeList();
  is(list.length, 0, "Length should be initially 0.");

  ok(NodeList.isInstance(list), "ChromeNodeList object should be an instance of NodeList.");

  try {
    list.append(document);
    ok(false, "should have throw!");
  } catch(ex) {
    ok(true, "ChromeNodeList supports only nsIContent objects for now.");
  }

  try {
    list.remove(document);
    ok(false, "should have throw!");
  } catch(ex) {
    ok(true, "ChromeNodeList supports only nsIContent objects for now.");
  }
  is(list.length, 0, "Length should be 0.");

  list.append(document.documentElement);
  is(list.length, 1, "Length should be 1.");
  is(list[0], document.documentElement);
  is(list[1], undefined);

  // Removing element which isn't in the list shouldn't do anything.
  list.remove(document.createXULElement("foo"));
  is(list.length, 1, "Length should be 1.");
  is(list[0], document.documentElement);

  list.remove(document.documentElement);
  is(list.length, 0, "Length should be 0.");
  is(list[0], undefined);

  var e1 = document.createXULElement("foo");
  var e2 = document.createXULElement("foo");
  var e3 = document.createXULElement("foo");

  list.append(e1);
  list.append(e2);
  list.append(e3);

  is(list[0], e1);
  is(list[1], e2);
  is(list[2], e3);
  is(list.length, 3);

  list.remove(e2);
  is(list[0], e1);
  is(list[1], e3);
  is(list[2], undefined);
  is(list.length, 2);

  // A leak test.
  list.expando = list;

  ]]>
  </script>
</window>

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