Commit bc2a8bc1 authored by Masayuki Nakano's avatar Masayuki Nakano
Browse files

Bug 1691622 - part 7: Merge `synthesizeNativeMouseMove*` with `synthesizeNativeMouseEvent*` r=smaug

parent 44ff291c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -42,7 +42,12 @@ let stub = sinon

registerCleanupFunction(async function() {
  stub.restore();
  await EventUtils.synthesizeNativeMouseMove(document.documentElement, 0, 0);
  EventUtils.synthesizeNativeMouseEvent({
    type: "mousemove",
    target: document.documentElement,
    offsetX: 0,
    offsetY: 0,
  });
  await PlacesUtils.history.clear();
});

+5 −7
Original line number Diff line number Diff line
@@ -510,13 +510,11 @@ add_task(async function mouse_hovering_panel_should_prevent_autoclose() {
  await test_bookmarks_popup({
    isNewBookmark: true,
    async popupShowFn() {
      await new Promise(resolve => {
        EventUtils.synthesizeNativeMouseMove(
          document.documentElement,
          editBookmarkPanelRemoveButtonRect.left,
          editBookmarkPanelRemoveButtonRect.top,
          resolve
        );
      await EventUtils.promiseNativeMouseEvent({
        type: "mousemove",
        target: document.documentElement,
        offsetX: editBookmarkPanelRemoveButtonRect.left,
        offsetY: editBookmarkPanelRemoveButtonRect.top,
      });
      EventUtils.synthesizeKey("D", { accelKey: true }, window);
    },
+6 −1
Original line number Diff line number Diff line
@@ -79,5 +79,10 @@ add_task(async function telemetry() {
  BrowserTestUtils.removeTab(tab);

  // Move the cursor out of the panel area to avoid messing with other tests.
  await EventUtils.synthesizeNativeMouseMove(searchbar);
  await EventUtils.promiseNativeMouseEvent({
    type: "mousemove",
    target: searchbar,
    offsetX: 0,
    offsetY: 0,
  });
});
+7 −7
Original line number Diff line number Diff line
@@ -225,11 +225,11 @@ async function promiseClosePopup(popup) {
  await promise;

  // Move the cursor out of the panel area to avoid messing with other tests.
  await EventUtils.synthesizeNativeMouseMove(
    popup,
    undefined,
    undefined,
    undefined,
    popup.ownerGlobal
  );
  EventUtils.synthesizeNativeMouseEvent({
    type: "mousemove",
    target: popup,
    offsetX: 0,
    offsetY: 0,
    win: popup.ownerGlobal,
  });
}
+5 −7
Original line number Diff line number Diff line
@@ -30,13 +30,11 @@ add_task(async function prepare() {

  // Move the mouse away from the urlbar one-offs so that a one-off engine is
  // not inadvertently selected.
  await new Promise(resolve => {
    EventUtils.synthesizeNativeMouseMove(
      window.document.documentElement,
      0,
      0,
      resolve
    );
  await EventUtils.promiseNativeMouseEvent({
    type: "mousemove",
    target: window.document.documentElement,
    offsetX: 0,
    offsetY: 0,
  });
});

Loading