Bug 1163640 - Fix the test for bug 417418 to not leave the widget in a drag session. r=ehsan
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 11 May 2015 17:21:30 -0400
changeset 243420 96c05b12bcc2f92ce15a5965f0c524489ff83d51
parent 243419 323f7903341d9a78f8fa2b6d316fafd7375b25cc
child 243421 5655a0ee61f23580f9e90c13e2ce727867351dff
push id28738
push usercbook@mozilla.com
push dateTue, 12 May 2015 14:11:31 +0000
treeherderautoland@bedce1b405a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1163640, 417418
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1163640 - Fix the test for bug 417418 to not leave the widget in a drag session. r=ehsan
editor/libeditor/tests/test_bug417418.html
--- a/editor/libeditor/tests/test_bug417418.html
+++ b/editor/libeditor/tests/test_bug417418.html
@@ -20,49 +20,54 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 417418 **/
 SimpleTest.waitForExplicitFinish();
 SimpleTest.waitForFocus(runTest);
-SimpleTest.expectAssertions(0, 1);
 
 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();
 }