Bug 1059767 - browser_markupview_events-overflow.js: Fix precision error in alignment r=me
authorMichael Ratcliffe <mratcliffe@mozilla.com>
Thu, 28 Aug 2014 14:29:55 +0100
changeset 223815 12a5e1b45d1cade707483ac8a7574c26fedd0bdc
parent 223814 d2d24213e4aaf358a34bec1633916dc6111c4ab8
child 223816 f6beabe7cfb60c8a405199cff263b5e7ecd5cd93
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1059767
milestone34.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 1059767 - browser_markupview_events-overflow.js: Fix precision error in alignment r=me
browser/devtools/markupview/test/browser_markupview_events-overflow.js
--- a/browser/devtools/markupview/test/browser_markupview_events-overflow.js
+++ b/browser/devtools/markupview/test/browser_markupview_events-overflow.js
@@ -62,26 +62,29 @@ let test = asyncTest(function*() {
     let header = headers[data.headerToClick];
 
     let ready = tooltip.once("event-tooltip-ready");
     EventUtils.synthesizeMouseAtCenter(header, {}, header.ownerGlobal);
     yield ready;
 
     info("Event handler expanded.");
 
+    // Wait for any scrolling to finish.
+    yield promiseNextTick();
+
     if (data.alignTop) {
       let headerRect = header.getBoundingClientRect();
 
-      is(headerRect.top, containerRect.top,
+      is(Math.round(headerRect.top), Math.round(containerRect.top),
         "Clicked header is aligned with the container top.");
 
     } else if (data.alignBottom) {
       let editorRect = header.nextElementSibling.getBoundingClientRect();
 
-      is(editorRect.bottom, containerRect.bottom,
+      is(Math.round(editorRect.bottom), Math.round(containerRect.bottom),
         "Clicked event handler code is aligned with the container bottom.");
 
     } else {
       is(container.scrollTop, data.initialScrollTop,
         "Container did not scroll, as expected.");
     }
   }
 });