Chromium Code Reviews| Index: LayoutTests/fast/events/dispatch-synthetic-keyboardevent-no-action.html |
| diff --git a/LayoutTests/fast/events/dispatch-synthetic-keyboardevent-no-action.html b/LayoutTests/fast/events/dispatch-synthetic-keyboardevent-no-action.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..08ac14ed08b92c2d0cdbaf5d5383c5cd648f2d17 |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/dispatch-synthetic-keyboardevent-no-action.html |
| @@ -0,0 +1,27 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/js-test.js"></script> |
| +<p id="description"></p> |
| +<form> |
| +<input type="radio" id="radio1" name="foo" value="A" checked/> |
| +<input type="radio" id="radio2" name="foo" value="B" /> |
| +</form> |
| +<pre id="console"></pre> |
| +<script> |
| +description("Tests to ensure that default action does not occur for untrusted events."); |
| + |
| +function test() |
|
tkent
2015/07/22 23:15:02
You don't need to define the function |test()|.
dtapuska
2015/07/23 01:28:10
Done.
|
| +{ |
| + if (window.testRunner) |
| + testRunner.dumpAsText(); |
|
tkent
2015/07/22 23:15:03
This is unnecessary. js-test.js does it.
dtapuska
2015/07/23 01:28:10
Done.
|
| + |
| + var node = document.getElementById('radio1'); |
| + var client = node.getBoundingClientRect(); |
|
tkent
2015/07/22 23:15:02
|client| is not used.
dtapuska
2015/07/23 01:28:10
Done.
|
| + |
| + var event = new KeyboardEvent('keydown', { keyIdentifier: 'Down' } ); |
| + node.dispatchEvent(event); |
| + shouldBeTrue("document.getElementById('radio1').checked"); |
| + shouldBeFalse("document.getElementById('radio2').checked"); |
| +} |
| + |
| +test(); |
| +</script> |