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

Unified 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: Add Yosemite exceptions 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 side-by-side diff with in-line comments
Download patch
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..c36d5d43ffce9db497b1ca2cba24da5131708bba
--- /dev/null
+++ b/LayoutTests/fast/events/dispatch-synthetic-keyboardevent-no-action.html
@@ -0,0 +1,19 @@
+<!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.");
+
+var node = document.getElementById('radio1');
+node.getBoundingClientRect();
+
+var event = new KeyboardEvent('keydown', { keyIdentifier: 'Down' } );
+node.dispatchEvent(event);
+shouldBeTrue("document.getElementById('radio1').checked");
+shouldBeFalse("document.getElementById('radio2').checked");
+</script>

Powered by Google App Engine
This is Rietveld 408576698