Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: LayoutTests/platform/chromium/fast/forms/calendar-picker/week-picker-touch-operations.html

Issue 14120003: Move LayoutTests from platform/chromium/... to generic location (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../../../fast/js/resources/js-test-pre.js"></script>
5 <script src="../../../../../fast/forms/resources/common.js"></script>
6 <script src="../../../../../fast/forms/resources/picker-common.js"></script>
7 <script src="resources/calendar-picker-common.js"></script>
8 </head>
9 <body>
10 <p id="description"></p>
11 <div id="console"></div>
12 <input type=week id=week value="2000-W01">
13 <script>
14 description("Tests if calendar picker mouse operations work as expected.");
15
16 debug('Check that page popup doesn\'t exist at first.');
17 shouldBeNull('document.getElementById("mock-page-popup")');
18
19 openPicker(document.getElementById('week'), test);
20
21 function test() {
22 debug('Open the month popup.');
23 shouldBeFalse('popupWindow.global.picker.monthPopupView.isVisible');
24 clickMonthPopupButton();
25 shouldBeTrue('popupWindow.global.picker.monthPopupView.isVisible');
26
27 debug('Check that touch swiping scrolls the list in the month popup.');
28
29 window.internals.settings.setTouchEventEmulationEnabled(true);
30 checkYearListViewScrollOffset();
31
32 popupWindow.global.picker.monthPopupView.yearListView.element.addEventListen er('touchend', testAfterSwipingDown, false);
33 hoverOverMonthButton(2000, 0);
34 eventSender.mouseDown();
35 hoverOverMonthButton(2000, 11);
36 eventSender.mouseUp();
37 }
38
39 function testAfterSwipingDown() {
40 shouldBeTrue('checkYearListViewScrollOffset() > 0');
41 popupWindow.global.picker.monthPopupView.yearListView.element.removeEventLis tener('touchend', testAfterSwipingDown, false);
42 setTimeout(testSwipingUp, 0);
43 }
44
45 function testSwipingUp() {
46 checkYearListViewScrollOffset();
47 popupWindow.global.picker.monthPopupView.yearListView.element.addEventListen er('touchend', testAfterSwipingUp, false);
48 eventSender.mouseDown();
49 hoverOverMonthPopupButton();
50 eventSender.mouseUp();
51 }
52
53 function testAfterSwipingUp() {
54 shouldBeTrue('checkYearListViewScrollOffset() < 0');
55 popupWindow.global.picker.monthPopupView.yearListView.element.removeEventLis tener('touchend', testAfterSwipingUp, false);
56 window.internals.settings.setTouchEventEmulationEnabled(false);
57 finishJSTest();
58 }
59 </script>
60 <script src="../../../../../fast/js/resources/js-test-post.js"></script>
61 </body>
62 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698