Bug 716031. Fix editor test to not assume simply doing a timeout will flush layout. r=ehsan pending
authorBoris Zbarsky <bzbarsky@mit.edu>
Sat, 14 Jan 2012 22:54:48 -0500
changeset 84471 1e0405f18207dfa14ea1b2543276239f4e238351
parent 84470 59cb54c6dfe12005af95a12314dd88eb46e0cccc
child 84472 b820017dc73895c618cb9a3ddb9affea72636f7c
push id4919
push userbzbarsky@mozilla.com
push dateSun, 15 Jan 2012 04:13:42 +0000
treeherdermozilla-inbound@5e6e63f3aed8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs716031
milestone12.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 716031. Fix editor test to not assume simply doing a timeout will flush layout. r=ehsan pending
editor/libeditor/base/tests/test_selection_move_commands.xul
--- a/editor/libeditor/base/tests/test_selection_move_commands.xul
+++ b/editor/libeditor/base/tests/test_selection_move_commands.xul
@@ -27,22 +27,26 @@ function execTests() {
   var root = doc.documentElement;
   var body = doc.body;
 
   body.style.fontSize='16px';
   body.style.lineHeight='16px';
   body.style.height='400px';
   body.style.padding='0px';
   body.style.margin='0px';
-  body.style.borderSize='0px';
+  body.style.borderWidth='0px';
 
   var sel = win.getSelection();
   doc.designMode='on';
   body.innerHTML = "1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<br>12<br>";
   win.focus();
+  // Flush out layout to make sure that the subdocument will be the size we
+  // expect by the time we try to scroll it.
+  is(body.getBoundingClientRect().height, 400,
+     "Body height should be what we set it to");
   yield;
 
   function doCommand(cmd) {
     var controller = document.commandDispatcher.getControllerForCommand(cmd);
     if (controller) {
       controller.doCommand(cmd);
     }
   }