tor-browser

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

007.html (1664B)


      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>Drag and drop between iframes: dropping block element onto canvas</title>
     10  <style type="text/css">
     11    iframe {
     12      width: 300px;
     13      height: 200px;
     14      border-style: none;
     15    }
     16  </style>
     17 </head>
     18 <body>
     19  <p><iframe src="helper-drag-me-green-box.xhtml" id="drag-iframe">Green box</iframe></p>
     20  <p>Drag green box above to the gray canvas below. Canvas should turn green when you drop green box on it.</p>
     21  <p><iframe src="helper-drop-here-canvas.xhtml" id="drop-iframe">Canvas</iframe></p>
     22  <script>
     23    async function test() {
     24      await new Promise(loaded => window.addEventListener("load", loaded));
     25      const div = frames[0].document.querySelector('div');
     26      const canvas = frames[1].document.querySelector('canvas');
     27 
     28      function onDropCallBack(event) {
     29        let style = window.getComputedStyle(canvas);
     30        let currentColor = "rgba(0, 0, 0, 0)";
     31        assert_equals(style.getPropertyValue("background-color"), currentColor);
     32        return true;
     33      }
     34 
     35      const dragIframe = document.getElementById('drag-iframe');
     36      const dropIframe = document.getElementById('drop-iframe');
     37      dragDropTest(div, canvas, onDropCallBack, 'Dragging the iframe to the bottom iframe should turn it green',
     38        dragIframe, dropIframe);
     39    }
     40    test();
     41  </script>
     42 </body>
     43 </html>