Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharnessreport.js"></script> | |
| 4 | |
| 5 <div id="wrapper1"> | |
| 6 <button id="button1">Button</button> | |
| 7 </div> | |
| 8 | |
| 9 <script> | |
| 10 async_test(function(t) | |
| 11 { | |
| 12 var axButton = accessibilityController.accessibleElementById("button1"); | |
| 13 axButton.addNotificationListener(function(notification) { | |
| 14 if (notification == 'Clicked') { | |
| 15 document.getElementById("wrapper1").style.display = "none"; | |
| 16 t.done(); | |
| 17 } | |
| 18 }); | |
| 19 | |
| 20 var button = document.getElementById("button1"); | |
| 21 button.click(); | |
| 22 }, "clicking a button via javascript sends an accessible click event"); | |
| 23 </script> | |
| 24 | |
| 25 <div id="wrapper2"> | |
| 26 <button id="button2">Button</button> | |
| 27 </div> | |
| 28 | |
| 29 <script> | |
| 30 async_test(function(t) | |
| 31 { | |
| 32 var axButton = accessibilityController.accessibleElementById("button2"); | |
| 33 axButton.addNotificationListener(function(notification) { | |
| 34 if (notification == 'Clicked') { | |
| 35 document.getElementById("wrapper2").style.display = "none"; | |
| 36 t.done(); | |
| 37 } | |
| 38 }); | |
| 39 | |
| 40 eventSender.mouseMoveTo(axButton.x + 10, axButton.y + 10); | |
| 41 eventSender.mouseDown(); | |
| 42 eventSender.mouseUp(); | |
| 43 }, "clicking a button via mouse events sends an accessible click event"); | |
| 44 </script> | |
| 45 | |
| 46 <div id="wrapper3"> | |
| 47 <button id="button3">Button</button> | |
| 48 </div> | |
| 49 | |
| 50 <script> | |
| 51 async_test(function(t) | |
| 52 { | |
| 53 var axButton = accessibilityController.accessibleElementById("button3"); | |
| 54 axButton.addNotificationListener(function(notification) { | |
| 55 if (notification == 'Clicked') { | |
| 56 document.getElementById("wrapper3").style.display = "none"; | |
| 57 t.done(); | |
| 58 } | |
| 59 }); | |
| 60 | |
| 61 var button = document.getElementById("button3"); | |
| 62 button.focus(); | |
| 63 eventSender.keyDown("\r"); | |
| 64 }, "clicking a button via the keyboard sends an accessible click event"); | |
| 65 </script> | |
| 66 | |
| 67 <div id="wrapper4"> | |
| 68 <button id="button4">Button</button> | |
| 69 </div> | |
| 70 | |
| 71 <script> | |
| 72 async_test(function(t) | |
| 73 { | |
| 74 var axButton = accessibilityController.accessibleElementById("button4"); | |
| 75 axButton.addNotificationListener(function(notification) { | |
| 76 if (notification == 'Clicked') { | |
| 77 document.getElementById("wrapper4").style.display = "none"; | |
| 78 t.done(); | |
| 79 } | |
| 80 }); | |
| 81 | |
| 82 axButton.press(); | |
| 83 }, "clicking a button via accessibility sends an accessible click event"); | |
| 84 </script> | |
| 85 | |
| 86 <div id="wrapper5"> | |
| 87 <button id="button5">Button</button> | |
| 88 </div> | |
| 89 | |
| 90 <script> | |
| 91 async_test(function(t) | |
| 92 { | |
| 93 var axButton = accessibilityController.accessibleElementById("button5"); | |
| 94 axButton.addNotificationListener(function(notification) { | |
| 95 if (notification == 'Clicked') { | |
| 96 assert_unreached("There shouldn't be a Clicked notification."); | |
| 97 } | |
| 98 }); | |
| 99 | |
| 100 eventSender.dragMode = true; | |
|
aboxhall
2016/02/08 18:07:12
Add another test for dragging into the button inst
dmazzoni
2016/02/08 21:34:46
Done.
| |
| 101 eventSender.mouseMoveTo(axButton.x + 10, axButton.y + 10); | |
| 102 eventSender.mouseDown(); | |
| 103 eventSender.leapForward(100); | |
| 104 eventSender.mouseMoveTo(axButton.x + 10, axButton.y + 100); | |
| 105 eventSender.mouseUp(); | |
| 106 | |
| 107 // Make the test pass after a short delay. The test passes if the | |
| 108 // accessible click event does not fire. | |
| 109 window.setTimeout(function() { | |
| 110 document.getElementById("wrapper5").style.display = "none"; | |
| 111 t.done(); | |
| 112 }, 200); | |
|
aboxhall
2016/02/08 18:07:12
I suspect this timeout could be zero - the accessi
dmazzoni
2016/02/08 21:34:46
Good idea. Seems to work!
| |
| 113 }, "dragging the mouse off a button does not send an accessible click event"); | |
| 114 </script> | |
|
aboxhall
2016/02/08 18:07:12
What about another test for touch? https://code.go
dmazzoni
2016/02/08 21:34:46
Good idea! Done.
| |
| OLD | NEW |