toolkit/content/tests/widgets/test_editor_currentURI.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/content/tests/widgets/test_editor_currentURI.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<?xml-stylesheet href="chrome://global/skin"
     1.6 +                 type="text/css"?>
     1.7 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
     1.8 +                 type="text/css"?>
     1.9 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    1.10 +        title="Editor currentURI Tests" onload="runTest();">
    1.11 +  <script type="application/javascript"
    1.12 +          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
    1.13 +  <script type="application/javascript"
    1.14 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
    1.15 +
    1.16 +  <body xmlns="http://www.w3.org/1999/xhtml">
    1.17 +  <p/>
    1.18 +  <editor xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    1.19 +          id="editor"
    1.20 +          type="content"
    1.21 +          editortype="html"
    1.22 +          style="width: 400px; height: 100px;"/>
    1.23 +  <p/>
    1.24 +  <pre id="test">
    1.25 +  </pre>
    1.26 +  </body>
    1.27 +  <script class="testbody" type="application/javascript">
    1.28 +  <![CDATA[
    1.29 +
    1.30 +  SimpleTest.waitForExplicitFinish();
    1.31 +
    1.32 +  function runTest() {
    1.33 +    var editor = document.getElementById("editor");
    1.34 +    // Check that currentURI is a property of editor.
    1.35 +    var result = "currentURI" in editor;
    1.36 +    is(result, true, "currentURI is a property of editor");
    1.37 +    is(editor.currentURI.spec, "about:blank", "currentURI.spec is about:blank");
    1.38 +    SimpleTest.finish();
    1.39 +  }
    1.40 +]]>
    1.41 +</script>
    1.42 +</window>

mercurial