editor/libeditor/html/tests/test_bug599322.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/editor/libeditor/html/tests/test_bug599322.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=599322.patch
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 599322.patch</title>
    1.11 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.14 +</head>
    1.15 +<body>
    1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=599322.patch">Mozilla Bug 599322.patch</a>
    1.17 +<p id="display"></p>
    1.18 +<div id="content">
    1.19 +<div id="src">src<img src="/tests/editor/libeditor/html/tests/green.png"></div>
    1.20 +<iframe id="dst" src="javascript:;"></iframe>
    1.21 +</div>
    1.22 +<pre id="test">
    1.23 +<script type="application/javascript">
    1.24 +
    1.25 +/** Test for Bug 599322.patch **/
    1.26 +
    1.27 +SimpleTest.expectAssertions(1);
    1.28 +
    1.29 +SimpleTest.waitForExplicitFinish();
    1.30 +addLoadEvent(function() {
    1.31 +  var src = document.getElementById("src");
    1.32 +  var dst = document.getElementById("dst");
    1.33 +  var doc = dst.contentDocument;
    1.34 +  doc.open();
    1.35 +  doc.write("<html><head><base href='http://mochi.test:8888/'></head><body></body></html>");
    1.36 +  doc.close();
    1.37 +  SimpleTest.waitForFocus(function() {
    1.38 +    getSelection().selectAllChildren(src);
    1.39 +    SimpleTest.waitForClipboard("src",
    1.40 +      function() {
    1.41 +        synthesizeKey("c", {accelKey: true});
    1.42 +      },
    1.43 +      function() {
    1.44 +        dst.contentDocument.designMode = "on";
    1.45 +        dst.focus();
    1.46 +        dst.contentDocument.body.focus();
    1.47 +        synthesizeKey("v", {accelKey: true});
    1.48 +        is(dst.contentDocument.querySelector("img").src,
    1.49 +           document.querySelector("img").src,
    1.50 +           "The source should be correctly set based on the base URI");
    1.51 +        SimpleTest.finish();
    1.52 +      },
    1.53 +      function() {
    1.54 +        SimpleTest.finish();
    1.55 +      }
    1.56 +    );
    1.57 +  });
    1.58 +});
    1.59 +
    1.60 +</script>
    1.61 +</pre>
    1.62 +</body>
    1.63 +</html>

mercurial