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

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: 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..9b04f056879c08981cfb7f5cd3cd406474133352
--- /dev/null
+++ b/LayoutTests/fast/events/dispatch-synthetic-keyboardevent-no-action.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<p id="description"></p>
+<select id='top'><option>A</option><option>B</option></select>
+<pre id="console"></pre>
+<script>
+description("Tests to ensure that default action does not occur for untrusted events.");
+
+function test()
+{
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ var node = document.getElementById('top');
+ var client = node.getBoundingClientRect();
+
+ var event = new KeyboardEvent('keydown', { keyIdentifier: 'Down' } );
tkent 2015/07/17 05:50:41 On Mac, Down key opens the popup. We should dispa
dtapuska 2015/07/21 21:30:05 Done.
+ node.dispatchEvent(event);
+ shouldBeEqualToString("document.getElementById('top').value", "A");
+}
+
+test();
+</script>

Powered by Google App Engine
This is Rietveld 408576698