Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 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 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <p id="description">Test for dragging operations of <input type=range> whe n <code>readonly</code> or <code>disabled</code> are toggled.</p> | 7 <p id="description">Test for dragging operations of <input type=range> whe n <code>readonly</code> or <code>disabled</code> are toggled.</p> |
| 8 <div id="console"></div> | 8 <div id="console"></div> |
| 9 <input type="range" id="range1" min="0" max="100" value="50"> | 9 <input type="range" id="range1" min="0" max="100" value="50"> |
| 10 <input type="range" id="range2" min="0" max="100" value="50"> | 10 <input type="range" id="range2" min="0" max="100" value="50"> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 } | 45 } |
| 46 | 46 |
| 47 startDragFromCenter(); | 47 startDragFromCenter(); |
| 48 | 48 |
| 49 // Drag from center, to right edge, to left edge. | 49 // Drag from center, to right edge, to left edge. |
| 50 debug('readOnly=false, disabled=false'); | 50 debug('readOnly=false, disabled=false'); |
| 51 input.valueAsNumber = 50; | 51 input.valueAsNumber = 50; |
| 52 lastChangeEventCounter = changeEventCounter; | 52 lastChangeEventCounter = changeEventCounter; |
| 53 dragToRightEdge(); | 53 dragToRightEdge(); |
| 54 shouldBe('input.value', '"100"'); | 54 shouldBe('input.value', '"100"'); |
| 55 shouldBeGreaterThanOrEqual('changeEventCounter', 'lastChangeEventCounter + 1 '); | |
|
tkent
2014/01/14 01:00:51
We should check if 'change' event was NOT dispatch
Habib Virji
2014/01/14 10:23:42
Done. Updated test to check change event is not tr
| |
| 56 lastChangeEventCounter = changeEventCounter; | 55 lastChangeEventCounter = changeEventCounter; |
| 57 dragToLeftEdge(); | 56 dragToLeftEdge(); |
| 57 stopDrag(); | |
| 58 shouldBe('input.value', '"0"'); | 58 shouldBe('input.value', '"0"'); |
| 59 shouldBeGreaterThanOrEqual('changeEventCounter', 'lastChangeEventCounter + 1 '); | 59 shouldBeGreaterThanOrEqual('changeEventCounter', 'lastChangeEventCounter + 1 '); |
| 60 | 60 |
| 61 // Toggle (readonly | disabled). | 61 // Toggle (readonly | disabled). |
| 62 debug(field + '=true'); | 62 debug(field + '=true'); |
| 63 input[field] = true; | 63 input[field] = true; |
| 64 | 64 |
| 65 // Attempt to drag to right edge. Should not change. | 65 // Attempt to drag to right edge. Should not change. |
| 66 lastChangeEventCounter = changeEventCounter; | 66 lastChangeEventCounter = changeEventCounter; |
| 67 dragToRightEdge(); | 67 dragToRightEdge(); |
| 68 stopDrag(); | |
| 68 shouldBe('input.value', '"0"'); | 69 shouldBe('input.value', '"0"'); |
| 69 shouldBe('lastChangeEventCounter', 'changeEventCounter'); | 70 shouldBe('lastChangeEventCounter', 'changeEventCounter'); |
| 70 | |
| 71 stopDrag(); | |
| 72 } | 71 } |
| 73 | 72 |
| 74 | 73 |
| 75 // We want all mouse moves sent immediately. | 74 // We want all mouse moves sent immediately. |
| 76 window.eventSender.dragMode = false; | 75 window.eventSender.dragMode = false; |
| 77 | 76 |
| 78 debug('Tests for range dragging while it toggles to be readonly.'); | 77 debug('Tests for range dragging while it toggles to be readonly.'); |
| 79 testInput('range1', 'readOnly'); | 78 testInput('range1', 'readOnly'); |
| 80 debug(''); | 79 debug(''); |
| 81 | 80 |
| 82 debug('Tests for range dragging while it toggles to be disabled.'); | 81 debug('Tests for range dragging while it toggles to be disabled.'); |
| 83 testInput('range2', 'disabled'); | 82 testInput('range2', 'disabled'); |
| 84 debug(''); | 83 debug(''); |
| 85 | 84 |
| 86 </script> | 85 </script> |
| 87 </body> | 86 </body> |
| 88 </html> | 87 </html> |
| OLD | NEW |