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

Side by Side Diff: LayoutTests/fast/forms/suggestion-picker/datetimelocal-suggestion-picker-step-attribute.html

Issue 484353004: Test tidying: use "escape" and "backspace" with eventSender.keyDown() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More quoting consistency wibbles Created 6 years, 4 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 <script src="../../forms/resources/picker-common.js"></script> 5 <script src="../../forms/resources/picker-common.js"></script>
6 <script src="resources/suggestion-picker-common.js"></script> 6 <script src="resources/suggestion-picker-common.js"></script>
7 </head> 7 </head>
8 <body style="background-color: #bbbbbb;"> 8 <body style="background-color: #bbbbbb;">
9 <p id="description"></p> 9 <p id="description"></p>
10 <div id="console"></div> 10 <div id="console"></div>
(...skipping 20 matching lines...) Expand all
31 }; 31 };
32 32
33 function test1() { 33 function test1() {
34 popupWindow.focus(); 34 popupWindow.focus();
35 35
36 shouldBe('entryValues().length', '3'); 36 shouldBe('entryValues().length', '3');
37 shouldBeEqualToString('entryValues()[0]', '2012-11-22T01:00'); 37 shouldBeEqualToString('entryValues()[0]', '2012-11-22T01:00');
38 shouldBeEqualToString('entryValues()[1]', '2012-11-22T02:00'); 38 shouldBeEqualToString('entryValues()[1]', '2012-11-22T02:00');
39 shouldBeEqualToString('entryValues()[2]', '@openCalendarPicker'); 39 shouldBeEqualToString('entryValues()[2]', '@openCalendarPicker');
40 40
41 eventSender.keyDown('\x1B'); // Close picker. 41 eventSender.keyDown('escape'); // Close picker.
42 waitUntilClosing(test1AfterClosing); 42 waitUntilClosing(test1AfterClosing);
43 } 43 }
44 44
45 function test1AfterClosing() { 45 function test1AfterClosing() {
46 datetimeLocalElement.step = 60; 46 datetimeLocalElement.step = 60;
47 openPicker(datetimeLocalElement, test2); 47 openPicker(datetimeLocalElement, test2);
48 } 48 }
49 49
50 function test2() { 50 function test2() {
51 popupWindow.focus(); 51 popupWindow.focus();
52 52
53 shouldBe('entryValues().length', '5'); 53 shouldBe('entryValues().length', '5');
54 shouldBeEqualToString('entryValues()[0]', '2012-11-22T01:00'); 54 shouldBeEqualToString('entryValues()[0]', '2012-11-22T01:00');
55 shouldBeEqualToString('entryValues()[1]', '2012-11-22T01:01'); 55 shouldBeEqualToString('entryValues()[1]', '2012-11-22T01:01');
56 shouldBeEqualToString('entryValues()[2]', '2012-11-22T02:00'); 56 shouldBeEqualToString('entryValues()[2]', '2012-11-22T02:00');
57 shouldBeEqualToString('entryValues()[3]', '2012-11-22T02:01'); 57 shouldBeEqualToString('entryValues()[3]', '2012-11-22T02:01');
58 shouldBeEqualToString('entryValues()[4]', '@openCalendarPicker'); 58 shouldBeEqualToString('entryValues()[4]', '@openCalendarPicker');
59 59
60 eventSender.keyDown('\x1B'); // Close picker. 60 eventSender.keyDown('escape'); // Close picker.
61 waitUntilClosing(test2AfterClosing); 61 waitUntilClosing(test2AfterClosing);
62 } 62 }
63 63
64 function test2AfterClosing() { 64 function test2AfterClosing() {
65 datetimeLocalElement.step = 1; 65 datetimeLocalElement.step = 1;
66 openPicker(datetimeLocalElement, test3); 66 openPicker(datetimeLocalElement, test3);
67 } 67 }
68 68
69 function test3() { 69 function test3() {
70 popupWindow.focus(); 70 popupWindow.focus();
71 71
72 shouldBe('entryValues().length', '6'); 72 shouldBe('entryValues().length', '6');
73 shouldBeEqualToString('entryValues()[0]', '2012-11-22T01:00'); 73 shouldBeEqualToString('entryValues()[0]', '2012-11-22T01:00');
74 shouldBeEqualToString('entryValues()[1]', '2012-11-22T01:00:01'); 74 shouldBeEqualToString('entryValues()[1]', '2012-11-22T01:00:01');
75 shouldBeEqualToString('entryValues()[2]', '2012-11-22T01:01'); 75 shouldBeEqualToString('entryValues()[2]', '2012-11-22T01:01');
76 shouldBeEqualToString('entryValues()[3]', '2012-11-22T02:00'); 76 shouldBeEqualToString('entryValues()[3]', '2012-11-22T02:00');
77 shouldBeEqualToString('entryValues()[4]', '2012-11-22T02:01'); 77 shouldBeEqualToString('entryValues()[4]', '2012-11-22T02:01');
78 shouldBeEqualToString('entryValues()[5]', '@openCalendarPicker'); 78 shouldBeEqualToString('entryValues()[5]', '@openCalendarPicker');
79 79
80 eventSender.keyDown('\x1B'); // Close picker. 80 eventSender.keyDown('escape'); // Close picker.
81 waitUntilClosing(test3AfterClosing); 81 waitUntilClosing(test3AfterClosing);
82 } 82 }
83 83
84 function test3AfterClosing() { 84 function test3AfterClosing() {
85 datetimeLocalElement.step = 0.001; 85 datetimeLocalElement.step = 0.001;
86 openPicker(datetimeLocalElement, test4); 86 openPicker(datetimeLocalElement, test4);
87 } 87 }
88 88
89 function test4() { 89 function test4() {
90 popupWindow.focus(); 90 popupWindow.focus();
91 91
92 shouldBe('entryValues().length', '8'); 92 shouldBe('entryValues().length', '8');
93 shouldBeEqualToString('entryValues()[0]', '2012-11-22T01:00'); 93 shouldBeEqualToString('entryValues()[0]', '2012-11-22T01:00');
94 shouldBeEqualToString('entryValues()[1]', '2012-11-22T01:00:01'); 94 shouldBeEqualToString('entryValues()[1]', '2012-11-22T01:00:01');
95 shouldBeEqualToString('entryValues()[2]', '2012-11-22T01:00:01.001'); 95 shouldBeEqualToString('entryValues()[2]', '2012-11-22T01:00:01.001');
96 shouldBeEqualToString('entryValues()[3]', '2012-11-22T01:00:01.010'); 96 shouldBeEqualToString('entryValues()[3]', '2012-11-22T01:00:01.010');
97 shouldBeEqualToString('entryValues()[4]', '2012-11-22T01:01'); 97 shouldBeEqualToString('entryValues()[4]', '2012-11-22T01:01');
98 shouldBeEqualToString('entryValues()[5]', '2012-11-22T02:00'); 98 shouldBeEqualToString('entryValues()[5]', '2012-11-22T02:00');
99 shouldBeEqualToString('entryValues()[6]', '2012-11-22T02:01'); 99 shouldBeEqualToString('entryValues()[6]', '2012-11-22T02:01');
100 shouldBeEqualToString('entryValues()[7]', '@openCalendarPicker'); 100 shouldBeEqualToString('entryValues()[7]', '@openCalendarPicker');
101 101
102 finishJSTest(); 102 finishJSTest();
103 } 103 }
104 104
105 </script> 105 </script>
106 </body> 106 </body>
107 </html> 107 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698