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 '); | 55 shouldBeGreaterThanOrEqual('changeEventCounter', 'lastChangeEventCounter'); |
tkent
2014/01/14 10:29:23
This line should be shouldBe(...), not shouldBeGre
Habib Virji
2014/01/14 10:56:19
Done.
| |
56 lastChangeEventCounter = changeEventCounter; | 56 lastChangeEventCounter = changeEventCounter; |
57 dragToLeftEdge(); | 57 dragToLeftEdge(); |
58 stopDrag(); | |
58 shouldBe('input.value', '"0"'); | 59 shouldBe('input.value', '"0"'); |
59 shouldBeGreaterThanOrEqual('changeEventCounter', 'lastChangeEventCounter + 1 '); | 60 shouldBeGreaterThanOrEqual('changeEventCounter', 'lastChangeEventCounter + 1 '); |
60 | 61 |
61 // Toggle (readonly | disabled). | 62 // Toggle (readonly | disabled). |
62 debug(field + '=true'); | 63 debug(field + '=true'); |
63 input[field] = true; | 64 input[field] = true; |
64 | 65 |
65 // Attempt to drag to right edge. Should not change. | 66 // Attempt to drag to right edge. Should not change. |
66 lastChangeEventCounter = changeEventCounter; | 67 lastChangeEventCounter = changeEventCounter; |
67 dragToRightEdge(); | 68 dragToRightEdge(); |
69 stopDrag(); | |
68 shouldBe('input.value', '"0"'); | 70 shouldBe('input.value', '"0"'); |
69 shouldBe('lastChangeEventCounter', 'changeEventCounter'); | 71 shouldBe('lastChangeEventCounter', 'changeEventCounter'); |
70 | |
71 stopDrag(); | |
72 } | 72 } |
73 | 73 |
74 | 74 |
75 // We want all mouse moves sent immediately. | 75 // We want all mouse moves sent immediately. |
76 window.eventSender.dragMode = false; | 76 window.eventSender.dragMode = false; |
77 | 77 |
78 debug('Tests for range dragging while it toggles to be readonly.'); | 78 debug('Tests for range dragging while it toggles to be readonly.'); |
79 testInput('range1', 'readOnly'); | 79 testInput('range1', 'readOnly'); |
80 debug(''); | 80 debug(''); |
81 | 81 |
82 debug('Tests for range dragging while it toggles to be disabled.'); | 82 debug('Tests for range dragging while it toggles to be disabled.'); |
83 testInput('range2', 'disabled'); | 83 testInput('range2', 'disabled'); |
84 debug(''); | 84 debug(''); |
85 | 85 |
86 </script> | 86 </script> |
87 </body> | 87 </body> |
88 </html> | 88 </html> |
OLD | NEW |