js/xpconnect/tests/mochitest/test_bug393269.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/xpconnect/tests/mochitest/test_bug393269.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=393269
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 393269</title>
    1.11 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.13 +</head>
    1.14 +<body>
    1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=393269">Mozilla Bug 393269</a>
    1.16 +<iframe id="ifr"></iframe>
    1.17 +<pre id="test">
    1.18 +<script class="testbody" type="text/javascript">
    1.19 +
    1.20 +SimpleTest.expectAssertions(1, 2);
    1.21 +
    1.22 +(function () {
    1.23 +    /** Test for Bug 393269 **/
    1.24 +    var doc = $("ifr").contentDocument;
    1.25 +    is("UTF-8", doc.characterSet, "control, getting a property");
    1.26 +    doc.open();
    1.27 +    try {
    1.28 +        is("UTF-8", doc.characterSet,
    1.29 +           "can get a property after 1 document.open")
    1.30 +    } catch (e) {
    1.31 +        fail("Shouldn't have thrown: " + e);
    1.32 +        return;
    1.33 +    } finally {
    1.34 +        doc.close();
    1.35 +    }
    1.36 +
    1.37 +    doc.open();
    1.38 +    try {
    1.39 +        is("UTF-8", doc.characterSet,
    1.40 +           "can get a property after 2 document.opens")
    1.41 +    } catch (e) {
    1.42 +        fail("Shouldn't have thrown: " + e);
    1.43 +    } finally {
    1.44 +        doc.close();
    1.45 +    }
    1.46 +})();
    1.47 +</script>
    1.48 +</pre>
    1.49 +</body>
    1.50 +</html>
    1.51 +

mercurial