| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>ContextMenu Key: Reveal Focused Element</title> | 2 <title>ContextMenu Key: Reveal Focused Element</title> |
| 3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <style> | 5 <style> |
| 6 body { | 6 body { |
| 7 height: 3000px; | 7 height: 3000px; |
| 8 } | 8 } |
| 9 </style> | 9 </style> |
| 10 <input type="text" id="txt"> | 10 <input type="text" id="txt"> |
| 11 <a href="#" id="anchor">Anchor</a> | 11 <a href="#" id="anchor">Anchor</a> |
| 12 <script> | 12 <script> |
| 13 test(function() { | 13 test(function() { |
| 14 if (!window.eventSender) { | 14 if (!window.eventSender) { |
| 15 document.write('This test requires eventSender'); | 15 document.write('This test requires eventSender'); |
| 16 return; | 16 return; |
| 17 } | 17 } |
| 18 document.getElementById('txt').focus(); | 18 document.getElementById('txt').focus(); |
| 19 document.scrollingElement.scrollTop = 3000; | 19 document.scrollingElement.scrollTop = 3000; |
| 20 assert_not_equals(document.scrollingElement.scrollTop, 0); | 20 assert_not_equals(document.scrollingElement.scrollTop, 0); |
| 21 eventSender.keyDown("menu"); | 21 eventSender.keyDown("ContextMenu"); |
| 22 assert_equals(document.scrollingElement.scrollTop, 0); | 22 assert_equals(document.scrollingElement.scrollTop, 0); |
| 23 }, 'Testing ContextMenu key should reveal focused input.'); | 23 }, 'Testing ContextMenu key should reveal focused input.'); |
| 24 | 24 |
| 25 test(function() { | 25 test(function() { |
| 26 if (!window.eventSender) { | 26 if (!window.eventSender) { |
| 27 document.write('This test requires eventSender'); | 27 document.write('This test requires eventSender'); |
| 28 return; | 28 return; |
| 29 } | 29 } |
| 30 document.getElementById('anchor').focus(); | 30 document.getElementById('anchor').focus(); |
| 31 document.scrollingElement.scrollTop = 3000; | 31 document.scrollingElement.scrollTop = 3000; |
| 32 assert_not_equals(document.scrollingElement.scrollTop, 0); | 32 assert_not_equals(document.scrollingElement.scrollTop, 0); |
| 33 eventSender.keyDown("menu"); | 33 eventSender.keyDown("ContextMenu"); |
| 34 assert_equals(document.scrollingElement.scrollTop, 0); | 34 assert_equals(document.scrollingElement.scrollTop, 0); |
| 35 }, 'Testing ContextMenu key should reveal focused anchor.'); | 35 }, 'Testing ContextMenu key should reveal focused anchor.'); |
| 36 </script> | 36 </script> |
| OLD | NEW |