Chromium Code Reviews| Index: LayoutTests/fast/events/dispatch-synthetic-mouseevent-no-action.html |
| diff --git a/LayoutTests/fast/events/dispatch-synthetic-mouseevent-no-action.html b/LayoutTests/fast/events/dispatch-synthetic-mouseevent-no-action.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c9db4df4f03cb0d721f22f873e12497e52400a66 |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/dispatch-synthetic-mouseevent-no-action.html |
| @@ -0,0 +1,32 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/js-test.js"></script> |
| +<p id="description"></p> |
| +<select id='top'></select> |
| +<pre id="console"></pre> |
| +<script> |
| +description("Tests to ensure that default action does not occur."); |
|
Rick Byers
2015/06/11 00:06:48
nit: looks like you missed updating this: ..."for
|
| + |
| +function focusHandler() { |
| + testFailed('default action should not occur for mouse events from script.'); |
| +} |
| + |
| +function mousedownHandler() { |
| + debug('mousedown event is fired.'); |
| +} |
| + |
| +function test() |
| +{ |
| + if (window.testRunner) |
| + testRunner.dumpAsText(); |
| + |
| + var node = document.getElementById('top'); |
| + node.addEventListener('focus', focusHandler, false); |
| + node.addEventListener('mousedown', mousedownHandler, false); |
| + var client = node.getBoundingClientRect(); |
| + |
| + var event = new MouseEvent('mousedown', { button: 1 }); |
| + node.dispatchEvent(event); |
| +} |
| + |
| +test(); |
| +</script> |