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

Unified Diff: LayoutTests/fast/events/show-context-menu-on-mouse-up.html

Issue 776483002: Use the setting to determine whether showing context menu on mouse up. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add layout test and exclude modifiers part. Created 6 years 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/show-context-menu-on-mouse-up.html
diff --git a/LayoutTests/fast/events/show-context-menu-on-mouse-up.html b/LayoutTests/fast/events/show-context-menu-on-mouse-up.html
new file mode 100644
index 0000000000000000000000000000000000000000..9b5f04fdb72ec1d6d07fe34d6827dd83a32307fa
--- /dev/null
+++ b/LayoutTests/fast/events/show-context-menu-on-mouse-up.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<div id="region" style="width:100px; height:100px; position:absolute; left:0px; top:0px;"></div>
+<script src="../../resources/js-test.js"></script>
+<script>
+
+var eventLog = "";
+
+function appendEventLog(e)
+{
+ if (!window.eventSender)
+ return;
+
+ if (eventLog != "")
+ eventLog += " ";
+
+ eventLog += e.type;
+}
+
+function clearEventLog()
+{
+ eventLog = "";
+}
+
+function testEvents(settingFlag, expectedString)
+{
+ internals.settings.setShowContextMenuOnMouseUp(settingFlag);
+ debug("setShowContextMenuOnMouseUp setting = " + settingFlag);
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(50, 50);
+ eventSender.mouseDown(2);
+ eventSender.mouseUp(2);
+ }
+ shouldBeEqualToString("eventLog", expectedString);
+ debug("");
+ clearEventLog();
+}
+
+var region = document.getElementById("region");
+
+region.addEventListener("mousedown", appendEventLog, false);
+region.addEventListener("mouseup", appendEventLog, false);
+region.addEventListener("contextmenu", appendEventLog, false);
+
+testEvents(false, "mousedown contextmenu mouseup");
+testEvents(true, "mousedown mouseup contextmenu");
+
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/events/show-context-menu-on-mouse-up-expected.txt » ('j') | Source/core/page/EventHandler.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698