dom/tests/mochitest/general/test_for_of.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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