tor-browser

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

browser_mouse_resize.js (911B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 const TEST_URL = "data:text/html;charset=utf-8,";
      7 
      8 addRDMTask(
      9  TEST_URL,
     10  async function ({ ui, manager }) {
     11    const store = ui.toolWindow.store;
     12 
     13    // Wait until the viewport has been added
     14    await waitUntilState(store, state => state.viewports.length == 1);
     15 
     16    await setViewportSize(ui, manager, 300, 300);
     17 
     18    // Do horizontal + vertical resize
     19    await testViewportResize(ui, ".viewport-resize-handle", [10, 10], [10, 10]);
     20 
     21    // Do horizontal resize
     22    await testViewportResize(
     23      ui,
     24      ".viewport-horizontal-resize-handle",
     25      [-10, 10],
     26      [-10, 0]
     27    );
     28 
     29    // Do vertical resize
     30    await testViewportResize(
     31      ui,
     32      ".viewport-vertical-resize-handle",
     33      [-10, -10],
     34      [0, -10],
     35      ui
     36    );
     37  },
     38  { waitForDeviceList: true }
     39 );