fune/browser/base/content/test/gesture/browser_gesture_navigation.js
Hiroyuki Ikezoe a5ceb4d5dd Bug 1704065 - Don't start navigation swipe gestures where there is no navigation history. r=spohl
Apparently we should check each command specified by
browser.gesture.swipe.left or browser.gesture.swipe.right, it will be fixed
in bug 1707118.

Differential Revision: https://phabricator.services.mozilla.com/D113635
2021-04-30 09:08:08 +00:00

20 lines
606 B
JavaScript

/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
add_task(async () => {
// Open a new browser window to make sure there is no navigation history.
const newBrowser = await BrowserTestUtils.openNewBrowserWindow({});
let event = {
direction: SimpleGestureEvent.DIRECTION_LEFT,
};
ok(!newBrowser.gGestureSupport._shouldDoSwipeGesture(event));
event = {
direction: SimpleGestureEvent.DIRECTION_RIGHT,
};
ok(!newBrowser.gGestureSupport._shouldDoSwipeGesture(event));
await BrowserTestUtils.closeWindow(newBrowser);
});