Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: LayoutTests/fast/events/dispatch-synthetic-keyboardevent-no-action.html

Issue 1234613004: Only execute default actions on trusted events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master_event_trusted_main3
Patch Set: Rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <p id="description"></p>
4 <form>
5 <input type="radio" id="radio1" name="foo" value="A" checked/>
6 <input type="radio" id="radio2" name="foo" value="B" />
7 </form>
8 <pre id="console"></pre>
9 <script>
10 description("Tests to ensure that default action does not occur for untrusted ev ents.");
11
12 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.
13 {
14 if (window.testRunner)
15 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.
16
17 var node = document.getElementById('radio1');
18 var client = node.getBoundingClientRect();
tkent 2015/07/22 23:15:02 |client| is not used.
dtapuska 2015/07/23 01:28:10 Done.
19
20 var event = new KeyboardEvent('keydown', { keyIdentifier: 'Down' } );
21 node.dispatchEvent(event);
22 shouldBeTrue("document.getElementById('radio1').checked");
23 shouldBeFalse("document.getElementById('radio2').checked");
24 }
25
26 test();
27 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698