Use pepjs instead of our own pointerevent polyfill

This commit is contained in:
ahocevar
2019-08-28 21:48:06 +02:00
parent aca4a39863
commit 74e8e013cf
27 changed files with 197 additions and 2430 deletions

View File

@@ -2,7 +2,7 @@ import Map from '../../../../src/ol/Map.js';
import MapBrowserPointerEvent from '../../../../src/ol/MapBrowserPointerEvent.js';
import View from '../../../../src/ol/View.js';
import ExtentInteraction from '../../../../src/ol/interaction/Extent.js';
import PointerEvent from '../../../../src/ol/pointer/PointerEvent.js';
import Event from '../../../../src/ol/events/Event.js';
describe('ol.interaction.Extent', function() {
let map, interaction;
@@ -50,14 +50,14 @@ describe('ol.interaction.Extent', function() {
// calculated in case body has top < 0 (test runner with small window)
const position = viewport.getBoundingClientRect();
const shiftKey = opt_shiftKey !== undefined ? opt_shiftKey : false;
const pointerEvent = new PointerEvent(type, {
type: type,
button: button,
clientX: position.left + x + width / 2,
clientY: position.top - y + height / 2,
shiftKey: shiftKey,
preventDefault: function() {}
});
const pointerEvent = new Event();
pointerEvent.type = type;
pointerEvent.button = button;
pointerEvent.clientX = position.left + x + width / 2;
pointerEvent.clientY = position.top - y + height / 2;
pointerEvent.shiftKey = shiftKey;
pointerEvent.pointerId = 0;
pointerEvent.preventDefault = function() {};
const event = new MapBrowserPointerEvent(type, map, pointerEvent);
event.pointerEvent.pointerId = 1;
map.handleMapBrowserEvent(event);