Bug 1187582 - Add a test to make sure a middle click doesn't start markup view dragging;r=me
authorBrian Grinstead <bgrinstead@mozilla.com>
Wed, 29 Jul 2015 14:40:01 -0700
changeset 286967 ee18f1f6fdd499118dbec2b493f4119600e3f4d6
parent 286966 110b4a6848ab577836faf87a58ebe13458b32d7f
child 286968 c6f672a41983709d5096d7c9cbf438bf75fab85c
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1187582
milestone42.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 1187582 - Add a test to make sure a middle click doesn't start markup view dragging;r=me
browser/devtools/markupview/test/browser_markupview_dragdrop_isDragging.js
--- a/browser/devtools/markupview/test/browser_markupview_dragdrop_isDragging.js
+++ b/browser/devtools/markupview/test/browser_markupview_dragdrop_isDragging.js
@@ -20,27 +20,42 @@ add_task(function*() {
   el._onMouseDown({
     target: el.tagLine,
     pageX: rect.x,
     pageY: rect.y,
     stopPropagation: function() {},
     preventDefault: function() {}
   });
 
-  is(el.isDragging, false, "isDragging should not be set to true immedietly");
+  ok(!el.isDragging, "isDragging should not be set to true immediately");
 
   info("Waiting " + (GRAB_DELAY + 1) + "ms");
   yield wait(GRAB_DELAY + 1);
   ok(el.isDragging, "isDragging true after GRAB_DELAY has passed");
 
   let dropCompleted = once(inspector.markup, "drop-completed");
 
   info("Simulating mouseUp on #test");
   el._onMouseUp({
     target: el.tagLine,
     pageX: rect.x,
     pageY: rect.y
   });
 
   yield dropCompleted;
 
-  is(el.isDragging, false, "isDragging false after mouseUp");
+  ok(!el.isDragging, "isDragging false after mouseUp");
+
+  info("Simulating middle click on #test");
+  el._onMouseDown({
+    target: el.tagLine,
+    button: 1,
+    pageX: rect.x,
+    pageY: rect.y,
+    stopPropagation: function() {},
+    preventDefault: function() {}
+  });
+  ok(!el.isDragging, "isDragging should not be set to true immediately");
+
+  info("Waiting " + (GRAB_DELAY + 1) + "ms");
+  yield wait(GRAB_DELAY + 1);
+  ok(!el.isDragging, "isDragging never starts after middle click after mouseUp");
 });