tor-browser

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

014.xhtml (1409B)


      1 <?xml version="1.0" encoding="utf-8"?>
      2 <html xmlns="http://www.w3.org/1999/xhtml">
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/resources/testdriver.js"></script>
      6 <script src="/resources/testdriver-vendor.js"></script>
      7 <script src="/resources/testdriver-actions.js"></script>
      8 <script src="../resources/test-helper.js"></script>
      9 <head>
     10  <title>Drag and drop of image between two instances of document</title>
     11  <style>
     12    body {
     13      display: flex;
     14      flex-direction: column;
     15      height: 100vh;
     16    }
     17 
     18    iframe {
     19      flex: 1;
     20    }
     21  </style>
     22 </head>
     23 <body>
     24  <iframe src="014-1.xhtml" id="drag-iframe"></iframe>
     25  <iframe src="014-1.xhtml" id="drop-iframe"></iframe>
     26 </body>
     27 <script>
     28  async function test() {
     29    await new Promise(loaded => window.addEventListener("load", loaded));
     30    const img = frames[0].document.querySelector('img');
     31    const div = frames[1].document.querySelector('div');
     32 
     33    function onDropCallBack(event) {
     34      assert_equals(div.querySelector('img').src, img.src);
     35      return true;
     36    }
     37 
     38    const dragIframe = document.getElementById('drag-iframe');
     39    const dropIframe = document.getElementById('drop-iframe');
     40    dragDropTest(img, div, onDropCallBack, 'Dragging the image to the bottom div should copy the image there',
     41      dragIframe, dropIframe);
     42  }
     43  test();
     44 </script>
     45 </html>