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

Side by Side Diff: LayoutTests/fast/forms/suggestion-picker/time-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 19 matching lines...) Expand all
30 openPicker(timeElement, test1); 30 openPicker(timeElement, test1);
31 }; 31 };
32 32
33 function test1() { 33 function test1() {
34 popupWindow.focus(); 34 popupWindow.focus();
35 35
36 shouldBe('entryValues().length', '2'); 36 shouldBe('entryValues().length', '2');
37 shouldBeEqualToString('entryValues()[0]', '01:00'); 37 shouldBeEqualToString('entryValues()[0]', '01:00');
38 shouldBeEqualToString('entryValues()[1]', '02:00'); 38 shouldBeEqualToString('entryValues()[1]', '02:00');
39 39
40 eventSender.keyDown('\x1B'); // Close picker. 40 eventSender.keyDown('escape'); // Close picker.
41 waitUntilClosing(test1AfterClosing); 41 waitUntilClosing(test1AfterClosing);
42 } 42 }
43 43
44 function test1AfterClosing() { 44 function test1AfterClosing() {
45 timeElement.step = 60; 45 timeElement.step = 60;
46 openPicker(timeElement, test2); 46 openPicker(timeElement, test2);
47 } 47 }
48 48
49 function test2() { 49 function test2() {
50 popupWindow.focus(); 50 popupWindow.focus();
51 51
52 shouldBe('entryValues().length', '4'); 52 shouldBe('entryValues().length', '4');
53 shouldBeEqualToString('entryValues()[0]', '01:00'); 53 shouldBeEqualToString('entryValues()[0]', '01:00');
54 shouldBeEqualToString('entryValues()[1]', '01:01'); 54 shouldBeEqualToString('entryValues()[1]', '01:01');
55 shouldBeEqualToString('entryValues()[2]', '02:00'); 55 shouldBeEqualToString('entryValues()[2]', '02:00');
56 shouldBeEqualToString('entryValues()[3]', '02:01'); 56 shouldBeEqualToString('entryValues()[3]', '02:01');
57 57
58 eventSender.keyDown('\x1B'); // Close picker. 58 eventSender.keyDown('escape'); // Close picker.
59 waitUntilClosing(test2AfterClosing); 59 waitUntilClosing(test2AfterClosing);
60 } 60 }
61 61
62 function test2AfterClosing() { 62 function test2AfterClosing() {
63 timeElement.step = 1; 63 timeElement.step = 1;
64 openPicker(timeElement, test3); 64 openPicker(timeElement, test3);
65 } 65 }
66 66
67 function test3() { 67 function test3() {
68 popupWindow.focus(); 68 popupWindow.focus();
69 69
70 shouldBe('entryValues().length', '5'); 70 shouldBe('entryValues().length', '5');
71 shouldBeEqualToString('entryValues()[0]', '01:00'); 71 shouldBeEqualToString('entryValues()[0]', '01:00');
72 shouldBeEqualToString('entryValues()[1]', '01:00:01'); 72 shouldBeEqualToString('entryValues()[1]', '01:00:01');
73 shouldBeEqualToString('entryValues()[2]', '01:01'); 73 shouldBeEqualToString('entryValues()[2]', '01:01');
74 shouldBeEqualToString('entryValues()[3]', '02:00'); 74 shouldBeEqualToString('entryValues()[3]', '02:00');
75 shouldBeEqualToString('entryValues()[4]', '02:01'); 75 shouldBeEqualToString('entryValues()[4]', '02:01');
76 76
77 eventSender.keyDown('\x1B'); // Close picker. 77 eventSender.keyDown('escape'); // Close picker.
78 waitUntilClosing(test3AfterClosing); 78 waitUntilClosing(test3AfterClosing);
79 } 79 }
80 80
81 function test3AfterClosing() { 81 function test3AfterClosing() {
82 timeElement.step = 0.001; 82 timeElement.step = 0.001;
83 openPicker(timeElement, test4); 83 openPicker(timeElement, test4);
84 } 84 }
85 85
86 function test4() { 86 function test4() {
87 popupWindow.focus(); 87 popupWindow.focus();
88 88
89 shouldBe('entryValues().length', '7'); 89 shouldBe('entryValues().length', '7');
90 shouldBeEqualToString('entryValues()[0]', '01:00'); 90 shouldBeEqualToString('entryValues()[0]', '01:00');
91 shouldBeEqualToString('entryValues()[1]', '01:00:01'); 91 shouldBeEqualToString('entryValues()[1]', '01:00:01');
92 shouldBeEqualToString('entryValues()[2]', '01:00:01.001'); 92 shouldBeEqualToString('entryValues()[2]', '01:00:01.001');
93 shouldBeEqualToString('entryValues()[3]', '01:00:01.010'); 93 shouldBeEqualToString('entryValues()[3]', '01:00:01.010');
94 shouldBeEqualToString('entryValues()[4]', '01:01'); 94 shouldBeEqualToString('entryValues()[4]', '01:01');
95 shouldBeEqualToString('entryValues()[5]', '02:00'); 95 shouldBeEqualToString('entryValues()[5]', '02:00');
96 shouldBeEqualToString('entryValues()[6]', '02:01'); 96 shouldBeEqualToString('entryValues()[6]', '02:01');
97 97
98 finishJSTest(); 98 finishJSTest();
99 } 99 }
100 100
101 </script> 101 </script>
102 </body> 102 </body>
103 </html> 103 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698