tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_sequence_detection.html (1690B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1066432
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>Test for Bug 1066432</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11  <script type="application/javascript">
     12  /* global TestInterfaceJS */
     13  /** Test for Bug 1066432 */
     14  SimpleTest.waitForExplicitFinish();
     15  SpecialPowers.pushPrefEnv({set: [["dom.expose_test_interfaces", true]]}, function() {
     16    var testInterfaceJS = new TestInterfaceJS();
     17    ok(testInterfaceJS, "got a TestInterfaceJS object");
     18 
     19    var nonIterableObject = {[Symbol.iterator]: 5};
     20 
     21    try {
     22      testInterfaceJS.testSequenceOverload(nonIterableObject);
     23      ok(false, "Should have thrown in the overload case"); // see long comment above!
     24    } catch (e) {
     25      is(e.name, "TypeError", "Should get a TypeError for the overload case");
     26      ok(e.message.includes("not iterable"),
     27         "Should have a message about being non-iterable in the overload case");
     28    }
     29 
     30    try {
     31      testInterfaceJS.testSequenceUnion(nonIterableObject);
     32      ok(false, "Should have thrown in the union case");
     33    } catch (e) {
     34      is(e.name, "TypeError", "Should get a TypeError for the union case");
     35      ok(e.message.includes("not iterable"),
     36         "Should have a message about being non-iterable in the union case");
     37    }
     38 
     39    SimpleTest.finish();
     40  });
     41 
     42  </script>
     43 </head>
     44 <body>
     45 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1066432">Mozilla Bug 1066432</a>
     46 <p id="display"></p>
     47 <div id="content" style="display: none">
     48 
     49 </div>
     50 <pre id="test">
     51 </pre>
     52 </body>
     53 </html>