tor-browser

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

test_bug599322.html (1714B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=599322.patch
      5 -->
      6 <head>
      7  <title>Test for Bug 599322.patch</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <script src="/tests/SimpleTest/EventUtils.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11 </head>
     12 <body>
     13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=599322.patch">Mozilla Bug 599322.patch</a>
     14 <p id="display"></p>
     15 <div id="content">
     16 <div id="src">src<img src="/tests/editor/libeditor/tests/green.png"></div>
     17 <iframe id="dst" src="javascript:;"></iframe>
     18 </div>
     19 <pre id="test">
     20 <script type="application/javascript">
     21 
     22 /** Test for Bug 599322.patch */
     23 
     24 SimpleTest.waitForExplicitFinish();
     25 addLoadEvent(function() {
     26  var src = document.getElementById("src");
     27  var dst = document.getElementById("dst");
     28  var doc = dst.contentDocument;
     29  doc.open();
     30  doc.write("<html><head><base href='http://mochi.test:8888/'></head><body></body></html>");
     31  doc.close();
     32  SimpleTest.waitForFocus(function() {
     33    getSelection().selectAllChildren(src);
     34    SimpleTest.waitForClipboard("src",
     35      function() {
     36        synthesizeKey("c", {accelKey: true});
     37      },
     38      function() {
     39        dst.contentDocument.designMode = "on";
     40        dst.focus();
     41        dst.contentDocument.body.focus();
     42        synthesizeKey("v", {accelKey: true});
     43        is(dst.contentDocument.querySelector("img").src,
     44           document.querySelector("img").src,
     45           "The source should be correctly set based on the base URI");
     46        SimpleTest.finish();
     47      },
     48      function() {
     49        SimpleTest.finish();
     50      }
     51    );
     52  });
     53 });
     54 
     55 </script>
     56 </pre>
     57 </body>
     58 </html>