dom/tests/mochitest/general/test_for_of.html

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <title>Tests for for-of loops</title>
     5   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     6   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
     7 </head>
     8 <body onload="doTest()">
     9 <p id="display"></p>
    10 <div id="content" style="display: none"></div>
    11 <script>
    12 function doTest() {
    13   // DOM NodeLists are iterable.
    14   var a = [];
    15   for (var e of document.body.childNodes)
    16     if (e.nodeType === 1)
    17       a.push(e.tagName); 
    18   is("P DIV SCRIPT", a.join(" "), "for-of should see each element in the body");
    20   SimpleTest.finish();
    21 }
    22 SimpleTest.waitForExplicitFinish();
    23 </script>
    24 </body>
    25 </html>

mercurial