Bug 1163640 - Fix the test for bug 417418 to not leave the widget in a drag session. r=ehsan, a=test-only
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 11 May 2015 17:21:30 -0400
changeset 260508 df02fefaa438
parent 260507 05f48d80fcf8
child 260509 06cc113b476f
push id805
push userryanvm@gmail.com
push date2015-05-18 17:06 +0000
treeherdermozilla-release@4bfd19d00ed4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, test-only
bugs1163640, 417418
milestone38.0.5
Bug 1163640 - Fix the test for bug 417418 to not leave the widget in a drag session. r=ehsan, a=test-only
editor/libeditor/tests/test_bug417418.html
--- a/editor/libeditor/tests/test_bug417418.html
+++ b/editor/libeditor/tests/test_bug417418.html
@@ -26,42 +26,48 @@ https://bugzilla.mozilla.org/show_bug.cg
 SimpleTest.waitForExplicitFinish();
 SimpleTest.waitForFocus(runTest);
 
 function resetSelection() {
   window.getSelection().collapse(document.getElementById("coin"), 0);
 }
 
 function runTest() {
-    var rightClick = {type: 'mousedown', button: 2},
-        singleClick = {type: 'mousedown', button: 0};
+    var rightClickDown = {type: 'mousedown', button: 2},
+        rightClickUp = {type: 'mouseup', button: 2},
+        singleClickDown = {type: 'mousedown', button: 0},
+        singleClickUp = {type: 'mouseup', button: 0};
     var selection = window.getSelection();
 
     var div = document.getElementById('display');
     var img = document.getElementById('img');
     var divRect = div.getBoundingClientRect();
     var imgselected;
 
     resetSelection();
-    synthesizeMouse(div, divRect.width - 1, divRect.height - 1, rightClick);
+    synthesizeMouse(div, divRect.width - 1, divRect.height - 1, rightClickDown);
+    synthesizeMouse(div, divRect.width - 1, divRect.height - 1, rightClickUp);
     ok(selection.isCollapsed, "selection is not collapsed");
 
     resetSelection();
-    synthesizeMouse(div, divRect.width - 1, divRect.height - 1, singleClick);
+    synthesizeMouse(div, divRect.width - 1, divRect.height - 1, singleClickDown);
+    synthesizeMouse(div, divRect.width - 1, divRect.height - 1, singleClickUp);
     ok(selection.isCollapsed, "selection is not collapsed");
 
     resetSelection();
-    synthesizeMouseAtCenter(img, rightClick);
+    synthesizeMouseAtCenter(img, rightClickDown);
+    synthesizeMouseAtCenter(img, rightClickUp);
     imgselected = selection.anchorNode == img.parentNode &&
                       selection.anchorOffset === 1 &&
                       selection.rangeCount === 1;
     ok(imgselected, "image is not selected");
 
     resetSelection();
-    synthesizeMouseAtCenter(img, singleClick);
+    synthesizeMouseAtCenter(img, singleClickDown);
+    synthesizeMouseAtCenter(img, singleClickUp);
     imgselected = selection.anchorNode == img.parentNode &&
                       selection.anchorOffset === 1 &&
                       selection.rangeCount === 1;
     ok(imgselected, "image is not selected");
 
     SimpleTest.finish();
 }