summaryrefslogtreecommitdiffstats
path: root/devtools/client/responsive/test/browser/browser_mouse_resize.js
blob: 62aa1b1eaea2ab1d23f74cd220cc5f450d111981 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

const TEST_URL = "data:text/html;charset=utf-8,";

addRDMTask(
  TEST_URL,
  async function ({ ui, manager }) {
    const store = ui.toolWindow.store;

    // Wait until the viewport has been added
    await waitUntilState(store, state => state.viewports.length == 1);

    await setViewportSize(ui, manager, 300, 300);

    // Do horizontal + vertical resize
    await testViewportResize(ui, ".viewport-resize-handle", [10, 10], [10, 10]);

    // Do horizontal resize
    await testViewportResize(
      ui,
      ".viewport-horizontal-resize-handle",
      [-10, 10],
      [-10, 0]
    );

    // Do vertical resize
    await testViewportResize(
      ui,
      ".viewport-vertical-resize-handle",
      [-10, -10],
      [0, -10],
      ui
    );
  },
  { waitForDeviceList: true }
);