blob: 4857abc5d951a2f227bfdd7e773c87f6fe2afdd7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<!DOCTYPE html>
<html>
<head>
<script src="../../js/resources/js-test-pre.js"></script>
<script src="../../forms/resources/common.js"></script>
<script src="../../forms/resources/picker-common.js"></script>
<script src="resources/calendar-picker-common.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<input type=month id=month value="2000-01">
<script>
description("Tests if month picker mouse operations work as expected.");
debug('Check that page popup doesn\'t exist at first.');
shouldBeNull('document.getElementById("mock-page-popup")');
openPicker(document.getElementById('month'), test);
function test() {
debug('Open the month popup.');
shouldBeFalse('popupWindow.global.picker.monthPopupView.isVisible');
clickMonthPopupButton();
shouldBeTrue('popupWindow.global.picker.monthPopupView.isVisible');
debug('Check that touch swiping scrolls the list in the month popup.');
window.internals.settings.setTouchEventEmulationEnabled(true);
checkYearListViewScrollOffset();
popupWindow.global.picker.monthPopupView.yearListView.element.addEventListener('touchend', testAfterSwipingDown, false);
hoverOverMonthButton(2000, 0);
eventSender.mouseDown();
hoverOverMonthButton(2000, 11);
eventSender.mouseUp();
}
function testAfterSwipingDown() {
shouldBeTrue('checkYearListViewScrollOffset() > 0');
popupWindow.global.picker.monthPopupView.yearListView.element.removeEventListener('touchend', testAfterSwipingDown, false);
setTimeout(testSwipingUp, 0);
}
function testSwipingUp() {
checkYearListViewScrollOffset();
popupWindow.global.picker.monthPopupView.yearListView.element.addEventListener('touchend', testAfterSwipingUp, false);
eventSender.mouseDown();
hoverOverMonthPopupButton();
eventSender.mouseUp();
}
function testAfterSwipingUp() {
shouldBeTrue('checkYearListViewScrollOffset() < 0');
popupWindow.global.picker.monthPopupView.yearListView.element.removeEventListener('touchend', testAfterSwipingUp, false);
window.internals.settings.setTouchEventEmulationEnabled(false);
finishJSTest();
}
</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>
|