tor-browser

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

008.html (1550B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/resources/testdriver.js"></script>
      5 <script src="/resources/testdriver-vendor.js"></script>
      6 <script src="/resources/testdriver-actions.js"></script>
      7 <script src="../resources/test-helper.js"></script>
      8 <head>
      9  <title>dataURL image drag and drop between iframes</title>
     10  <style type="text/css">
     11    iframe {
     12      width: 160px;
     13      height: 160px;
     14      border-style: none;
     15    }
     16  </style>
     17 </head>
     18 <body>
     19  <p><iframe src="helper-drag-me-data-url-image.xhtml" id="drag-iframe">XHTML with image</iframe></p>
     20  <p>Drag circle above to the box below. It should be copied to the box once you drop it there.</p>
     21  <p><iframe src="helper-drop-image-here.xhtml" id="drop-iframe">XHTML with image</iframe></p>
     22  <script>
     23    async function test() {
     24      await new Promise(loaded => window.addEventListener("load", loaded));
     25      const dragIframe = document.getElementById('drag-iframe');
     26      const dropIframe = document.getElementById('drop-iframe');
     27      const div = frames[1].document.querySelector('div');
     28 
     29      function onDropCallBack(event) {
     30        const img = frames[0].document.querySelector('img');
     31        assert_equals(div.querySelector('img').src, img.src);
     32        return true;
     33      }
     34      dragDropTest(dragIframe, div, onDropCallBack,
     35        'Dragging a dataURL image within an iframe to another iframe should copy it there', dragIframe, dropIframe);
     36    }
     37    test();
     38  </script>
     39 </body>
     40 </html>