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

Side by Side Diff: LayoutTests/fast/forms/resources/input-live-pseudo-selectors.js

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 description("This test performs a check that :valid/:invalid CSS psudo selectors are lively applied."); 1 description("This test performs a check that :valid/:invalid CSS psudo selectors are lively applied.");
2 2
3 // Setup for static elements. 3 // Setup for static elements.
4 var form = document.createElement('form'); 4 var form = document.createElement('form');
5 document.body.appendChild(form); 5 document.body.appendChild(form);
6 var nonForm = document.createElement('div'); 6 var nonForm = document.createElement('div');
7 document.body.appendChild(nonForm); 7 document.body.appendChild(nonForm);
8 8
9 function makeInvalid() { 9 function makeInvalid() {
10 var i = document.createElement('input'); 10 var i = document.createElement('input');
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 el = makeInvalid(); 75 el = makeInvalid();
76 el.focus(); 76 el.focus();
77 el.value = 'abc'; 77 el.value = 'abc';
78 shouldBe(elBackground, 'validColor'); 78 shouldBe(elBackground, 'validColor');
79 79
80 debug('Change the value by key input:'); 80 debug('Change the value by key input:');
81 el = makeInvalid(); 81 el = makeInvalid();
82 el.focus(); 82 el.focus();
83 eventSender.keyDown('a'); 83 eventSender.keyDown('a');
84 shouldBe(elBackground, 'validColor'); 84 shouldBe(elBackground, 'validColor');
85 eventSender.keyDown('\x08', []); 85 eventSender.keyDown('backspace', []);
86 shouldBe(elBackground, 'invalidColor'); 86 shouldBe(elBackground, 'invalidColor');
87 87
88 // -------------------------------- 88 // --------------------------------
89 // Constraints change 89 // Constraints change
90 // -------------------------------- 90 // --------------------------------
91 debug('Change required:'); 91 debug('Change required:');
92 el = makeInvalid(); 92 el = makeInvalid();
93 el.required = false; 93 el.required = false;
94 shouldBe(elBackground, 'validColor'); 94 shouldBe(elBackground, 'validColor');
95 el.required = true; 95 el.required = true;
(...skipping 10 matching lines...) Expand all
106 106
107 debug('Change step:'); 107 debug('Change step:');
108 el = makeInvalid(); 108 el = makeInvalid();
109 el.value = '1'; 109 el.value = '1';
110 el.type = 'number'; 110 el.type = 'number';
111 shouldBe(elBackground, 'validColor'); 111 shouldBe(elBackground, 'validColor');
112 el.step = '2'; 112 el.step = '2';
113 shouldBe(elBackground, 'invalidColor'); 113 shouldBe(elBackground, 'invalidColor');
114 el.step = '0.5'; 114 el.step = '0.5';
115 shouldBe(elBackground, 'validColor'); 115 shouldBe(elBackground, 'validColor');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698