test('OSX - Razer Physical Mouse Wheel', () => {
const testData: IMouseWheelEvent[] = [
[1503409880776, -1, 0],
[1503409880791, -1, 0],
[1503409880810, -4, 0],
[1503409880820, -5, 0],
[1503409880848, -6, 0],
[1503409880876, -7, 0],
[1503409881319, -1, 0],
[1503409881387, -1, 0],
[1503409881407, -2, 0],
[1503409881443, -4, 0],
[1503409881444, -5, 0],
[1503409881470, -6, 0],
[1503409881496, -7, 0],
[1503409881812, -1, 0],
[1503409881829, -1, 0],
[1503409881850, -4, 0],
[1503409881871, -5, 0],
[1503409881896, -13, 0],
[1503409881914, -16, 0],
[1503409882551, -1, 0],
[1503409882589, -1, 0],
[1503409882625, -2, 0],
[1503409883035, -1, 0],
[1503409883098, -1, 0],
[1503409883143, -2, 0],
[1503409883217, -2, 0],
[1503409883270, -3, 0],
[1503409883388, -3, 0],
[1503409883531, -3, 0],
[1503409884095, -1, 0],
[1503409884122, -1, 0],
[1503409884160, -3, 0],
[1503409884208, -4, 0],
[1503409884292, -4, 0],
[1503409884447, -1, 0],
[1503409884788, -1, 0],
[1503409884835, -1, 0],
[1503409884898, -2, 0],
[1503409884965, -3, 0],
[1503409885085, -2, 0],
[1503409885552, -1, 0],
[1503409885619, -1, 0],
[1503409885670, -1, 0],
[1503409885733, -2, 0],
[1503409885784, -4, 0],
[1503409885916, -3, 0],
];
const classifier = new MouseWheelClassifier();
for (let i = 0, len = testData.length; i < len; i++) {
const [timestamp, deltaY, deltaX] = testData[i];
classifier.accept(timestamp, deltaX, deltaY);
const actual = classifier.isPhysicalMouseWheel();
assert.equal(actual, true);
}
});
请发表评论