2 <div id=
"region" style=
"width:100px; height:100px; position:absolute; left:0px; top:0px;"></div>
3 <script src=
"../../resources/js-test.js"></script>
8 function appendEventLog(e
)
10 if (!window
.eventSender
)
19 function clearEventLog()
24 function testEvents(settingFlag
, expectedString
)
26 internals
.settings
.setShowContextMenuOnMouseUp(settingFlag
);
27 debug("setShowContextMenuOnMouseUp setting = " + settingFlag
);
28 if (window
.eventSender
) {
29 eventSender
.mouseMoveTo(50, 50);
30 eventSender
.mouseDown(2);
31 eventSender
.mouseUp(2);
33 shouldBeEqualToString("eventLog", expectedString
);
38 var region
= document
.getElementById("region");
40 region
.addEventListener("mousedown", appendEventLog
, false);
41 region
.addEventListener("mouseup", appendEventLog
, false);
42 region
.addEventListener("contextmenu", appendEventLog
, false);
44 testEvents(false, "mousedown contextmenu mouseup");
45 testEvents(true, "mousedown mouseup contextmenu");