Replace goog.structs.Map with plain object
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
goog.provide('ol.test.pointer.TouchSource');
|
||||
|
||||
goog.require('goog.object');
|
||||
|
||||
describe('ol.pointer.TouchSource', function() {
|
||||
var handler;
|
||||
var target;
|
||||
@@ -46,7 +48,7 @@ describe('ol.pointer.TouchSource', function() {
|
||||
expect(pointerEvent2.clientX).to.be(30);
|
||||
expect(pointerEvent2.clientY).to.be(45);
|
||||
|
||||
expect(handler.pointerMap.getCount()).to.be(2);
|
||||
expect(goog.object.getCount(handler.pointerMap)).to.be(2);
|
||||
});
|
||||
|
||||
it('creates the right pointer events', function() {
|
||||
@@ -57,7 +59,7 @@ describe('ol.pointer.TouchSource', function() {
|
||||
{identifier: 3, clientX: 10, clientY: 11}
|
||||
]);
|
||||
expect(eventSpy.calledOnce).to.be.ok();
|
||||
expect(handler.pointerMap.getCount()).to.be(1);
|
||||
expect(goog.object.getCount(handler.pointerMap)).to.be(1);
|
||||
|
||||
// second touch (first touch still down)
|
||||
simulateTouchEvent('touchstart', [
|
||||
@@ -65,7 +67,7 @@ describe('ol.pointer.TouchSource', function() {
|
||||
], [{identifier: 3}, {identifier: 4}]
|
||||
);
|
||||
expect(eventSpy.calledTwice).to.be.ok();
|
||||
expect(handler.pointerMap.getCount()).to.be(2);
|
||||
expect(goog.object.getCount(handler.pointerMap)).to.be(2);
|
||||
|
||||
// first touch moves
|
||||
var moveEventSpy = sinon.spy();
|
||||
@@ -87,7 +89,7 @@ describe('ol.pointer.TouchSource', function() {
|
||||
], [{identifier: 3}, {identifier: 4}]
|
||||
);
|
||||
expect(upEventSpy.calledTwice).to.be.ok();
|
||||
expect(handler.pointerMap.getCount()).to.be(0);
|
||||
expect(goog.object.getCount(handler.pointerMap)).to.be(0);
|
||||
});
|
||||
|
||||
it('handles flawed touches', function() {
|
||||
@@ -98,7 +100,7 @@ describe('ol.pointer.TouchSource', function() {
|
||||
{identifier: 3, clientX: 10, clientY: 11}
|
||||
]);
|
||||
expect(eventSpy.calledOnce).to.be.ok();
|
||||
expect(handler.pointerMap.getCount()).to.be(1);
|
||||
expect(goog.object.getCount(handler.pointerMap)).to.be(1);
|
||||
|
||||
// second touch, but the first touch has disappeared
|
||||
var cancelEventSpy = sinon.spy();
|
||||
@@ -111,7 +113,7 @@ describe('ol.pointer.TouchSource', function() {
|
||||
|
||||
// the first (broken) touch is canceled
|
||||
expect(cancelEventSpy.calledOnce).to.be.ok();
|
||||
expect(handler.pointerMap.getCount()).to.be(1);
|
||||
expect(goog.object.getCount(handler.pointerMap)).to.be(1);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user