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

Side by Side Diff: LayoutTests/fast/dom/HTMLDialogElement/dialog-canceling.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 <style> 4 <style>
5 #bottom { 5 #bottom {
6 top: 100px; 6 top: 100px;
7 left: 100px; 7 left: 100px;
8 height: 300px; 8 height: 300px;
9 width: 300px; 9 width: 300px;
10 margin: 0; 10 margin: 0;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 event.preventDefault(); 56 event.preventDefault();
57 }); 57 });
58 58
59 bottomDialog.showModal(); 59 bottomDialog.showModal();
60 topDialog.showModal(); 60 topDialog.showModal();
61 61
62 if (!window.eventSender) 62 if (!window.eventSender)
63 return; 63 return;
64 64
65 debug('Top dialog event listener should prevent closing.'); 65 debug('Top dialog event listener should prevent closing.');
66 eventSender.keyDown("\x1B"); 66 eventSender.keyDown("escape");
67 shouldBeTrue('topDialog.open'); 67 shouldBeTrue('topDialog.open');
68 shouldBeTrue('bottomDialog.open'); 68 shouldBeTrue('bottomDialog.open');
69 69
70 debug('Top dialog should close.'); 70 debug('Top dialog should close.');
71 eventSender.keyDown("\x1B"); 71 eventSender.keyDown("escape");
72 shouldBeFalse('topDialog.open'); 72 shouldBeFalse('topDialog.open');
73 shouldBeTrue('bottomDialog.open'); 73 shouldBeTrue('bottomDialog.open');
74 74
75 debug('Input should swallow Escape mechanism.'); 75 debug('Input should swallow Escape mechanism.');
76 swallowInput.focus(); 76 swallowInput.focus();
77 eventSender.keyDown("\x1B"); 77 eventSender.keyDown("escape");
78 eventSender.keyDown("\x1B"); 78 eventSender.keyDown("escape");
79 eventSender.keyDown("\x1B"); 79 eventSender.keyDown("escape");
80 shouldBeFalse('topDialog.open'); 80 shouldBeFalse('topDialog.open');
81 shouldBeTrue('bottomDialog.open'); 81 shouldBeTrue('bottomDialog.open');
82 82
83 normalInput.focus(); 83 normalInput.focus();
84 debug('Bottom dialog event listener should prevent closing.'); 84 debug('Bottom dialog event listener should prevent closing.');
85 eventSender.keyDown("\x1B"); 85 eventSender.keyDown("escape");
86 shouldBeFalse('topDialog.open'); 86 shouldBeFalse('topDialog.open');
87 shouldBeTrue('bottomDialog.open'); 87 shouldBeTrue('bottomDialog.open');
88 88
89 debug('Bottom dialog should close.'); 89 debug('Bottom dialog should close.');
90 eventSender.keyDown("\x1B"); 90 eventSender.keyDown("escape");
91 shouldBeFalse('topDialog.open'); 91 shouldBeFalse('topDialog.open');
92 shouldBeFalse('bottomDialog.open'); 92 shouldBeFalse('bottomDialog.open');
93 93
94 debug('Pressing Escape now should do nothing.'); 94 debug('Pressing Escape now should do nothing.');
95 eventSender.keyDown("\x1B"); 95 eventSender.keyDown("escape");
96 shouldBeFalse('topDialog.open'); 96 shouldBeFalse('topDialog.open');
97 shouldBeFalse('bottomDialog.open'); 97 shouldBeFalse('bottomDialog.open');
98 98
99 bottomDialog.remove(); 99 bottomDialog.remove();
100 topDialog.remove(); 100 topDialog.remove();
101 } 101 }
102 102
103 test(); 103 test();
104 </script> 104 </script>
105 </body> 105 </body>
106 </html> 106 </html>
OLDNEW
« no previous file with comments | « LayoutTests/editing/undo/undo-deleteWord.html ('k') | LayoutTests/fast/events/drag-and-drop-autoscroll.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698