Bug 1215517 part.3 Test the result of eQuerySelectedText in runSetSelectionEventTest() for checking the behavior of ContentEventHandler::GetFlatTextOffsetOfRange() rs=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 20 Oct 2015 14:14:17 +0900
changeset 268485 4e79bfe043c8419874fff97657178408eb51ea63
parent 268484 9f97448cf56a8f5fe758f9d0ab271d87fb4f3aa7
child 268486 38558bb6671b53b51716c9a8d897b9eb1f3668a8
push id29551
push usercbook@mozilla.com
push dateTue, 20 Oct 2015 10:01:15 +0000
treeherdermozilla-central@f7b746b4e913 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1215517
milestone44.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 1215517 part.3 Test the result of eQuerySelectedText in runSetSelectionEventTest() for checking the behavior of ContentEventHandler::GetFlatTextOffsetOfRange() rs=smaug
widget/tests/window_composition_text_querycontent.xul
--- a/widget/tests/window_composition_text_querycontent.xul
+++ b/widget/tests/window_composition_text_querycontent.xul
@@ -2329,487 +2329,537 @@ function runSetSelectionEventTest()
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #1 (0, 6+kLFLen): selection anchor node should be the first text node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #1 (0, 6+kLFLen): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #1 (0, 6+kLFLen): selection focus node should be the root node of the editor");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #1 (0, 6+kLFLen): selection focus offset should be the count of children");
+  checkSelection(0, "abc" + kLF + "def", "runSetSelectionEventTest #1 (0, 6+kLFLen)");
 
   synthesizeSelectionSet(0, 100);
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #1 (0, 100): selection anchor node should be the first text node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #1 (0, 100): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #1 (0, 100): selection focus node should be the root node of the editor");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #1 (0, 100): selection focus offset should be the count of children");
+  checkSelection(0, "abc" + kLF + "def", "runSetSelectionEventTest #1 (0, 100)");
 
   synthesizeSelectionSet(2, 2 + kLFLen);
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #1 (2, 2+kLFLen): selection anchor node should be the first text node");
   is(selection.anchorOffset, 2,
      "runSetSelectionEventTest #1 (2, 2+kLFLen): selection anchor offset should be 2");
   is(selection.focusNode, contenteditable.lastChild,
      "runSetSelectionEventTest #1 (2, 2+kLFLen): selection focus node should be the last text node");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #1 (2, 2+kLFLen): selection focus offset should be 1");
+  checkSelection(2, "c" + kLF + "d", "runSetSelectionEventTest #1 (2, 2+kLFLen)");
 
   synthesizeSelectionSet(1, 2);
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #1 (1, 2): selection anchor node should be the first text node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #1 (1, 2): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #1 (1, 2): selection focus node should be the root node of the editor");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #1 (1, 2): selection focus offset should be 1");
+  checkSelection(1, "bc", "runSetSelectionEventTest #1 (1, 2)");
 
   synthesizeSelectionSet(3, kLFLen);
   is(selection.anchorNode, contenteditable,
      "runSetSelectionEventTest #1 (3, kLFLen): selection anchor node should be the root node of the editor");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #1 (3, kLFLen): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable.lastChild,
      "runSetSelectionEventTest #1 (3, kLFLen): selection focus node should be the last text node");
   is(selection.focusOffset, 0,
      "runSetSelectionEventTest #1 (3, kLFLen): selection focus offset should be 0");
+  checkSelection(3, kLF, "runSetSelectionEventTest #1 (3, kLFLen)");
 
   synthesizeSelectionSet(6+kLFLen, 0);
   is(selection.anchorNode, contenteditable,
      "runSetSelectionEventTest #1 (6+kLFLen, 0): selection anchor node should be the root node of the editor");
   is(selection.anchorOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #1 (6+kLFLen, 0): selection anchor offset should be the count of children");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #1 (6+kLFLen, 0): selection focus node should be the root node of the editor");
   is(selection.anchorOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #1 (6+kLFLen, 0): selection focus offset should be the count of children");
+  checkSelection(6 + kLFLen, "", "runSetSelectionEventTest #1 (6+kLFLen, 0)");
 
   synthesizeSelectionSet(100, 0);
   is(selection.anchorNode, contenteditable,
      "runSetSelectionEventTest #1 (100, 0): selection anchor node should be the root node of the editor");
   is(selection.anchorOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #1 (100, 0): selection anchor offset should be the count of children");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #1 (100, 0): selection focus node should be the root node of the editor");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #1 (100, 0): selection focus offset should be the count of children");
+  checkSelection(6 + kLFLen, "", "runSetSelectionEventTest #1 (100, 0)");
 
   // #2
   contenteditable.innerHTML = "<p>a<b>b</b>c</p><p>def</p>";
 
   synthesizeSelectionSet(0, 4);
   is(selection.anchorNode, contenteditable.firstChild.firstChild,
      "runSetSelectionEventTest #2 (0, 4): selection anchor node should be the first text node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #2 (0, 4): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable.lastChild.firstChild,
      "runSetSelectionEventTest #2 (0, 4): selection focus node should be the text node in the second <p> node");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #2 (0, 4): selection focus offset should be 1");
+  checkSelection(0, "abcd", "runSetSelectionEventTest #2 (0, 4)");
 
   synthesizeSelectionSet(0, 2);
   is(selection.anchorNode, contenteditable.firstChild.firstChild,
      "runSetSelectionEventTest #2 (0, 2): selection anchor node should be the first text node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #2 (0, 2): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable.firstChild.childNodes.item(1),
      "runSetSelectionEventTest #2 (0, 2): selection focus node should be the <b> node");
   is(selection.focusOffset, contenteditable.firstChild.childNodes.item(1).childNodes.length,
      "runSetSelectionEventTest #2 (0, 2): selection focus offset should be the count of the <b>'s children");
+  checkSelection(0, "ab", "runSetSelectionEventTest #2 (0, 2)");
 
   synthesizeSelectionSet(1, 2);
   is(selection.anchorNode, contenteditable.firstChild.childNodes.item(1).firstChild,
      "runSetSelectionEventTest #2 (1, 2): selection anchor node should be the text node in the <b> node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #2 (1, 2): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #2 (1, 2): selection focus node should be the first <p> node");
   is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #2 (1, 2): selection focus offset should be the count of last <p>'s children");
+  checkSelection(1, "bc", "runSetSelectionEventTest #2 (1, 2)");
 
   synthesizeSelectionSet(2, 2);
   is(selection.anchorNode, contenteditable.firstChild.lastChild,
      "runSetSelectionEventTest #2 (2, 2): selection anchor node should be the last text node in the first <p> node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #2 (2, 2): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable.lastChild.firstChild,
      "runSetSelectionEventTest #2 (2, 2): selection focus node should be the text node in the last <p> node");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #2 (2, 2): selection focus offset should be 1");
+  checkSelection(2, "cd", "runSetSelectionEventTest #2 (2, 2)");
 
   synthesizeSelectionSet(3, 1);
   is(selection.anchorNode, contenteditable.lastChild.firstChild,
      "runSetSelectionEventTest #2 (3, 1): selection anchor node should be the text node in the second <p> node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #2 (3, 1): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable.lastChild.firstChild,
      "runSetSelectionEventTest #2 (3, 1): selection focus node should be the text node in the second <p> node");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #2 (3, 1): selection focus offset should be 1");
+  checkSelection(3, "d", "runSetSelectionEventTest #2 (3, 1)");
 
   // #3
   contenteditable.innerHTML = "<div>abc<p>def</p></div>";
 
   synthesizeSelectionSet(1, 2);
   is(selection.anchorNode, contenteditable.firstChild.firstChild,
      "runSetSelectionEventTest #3 (1, 2): selection anchor node should be the first text node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #3 (1, 2): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #3 (1, 2): selection focus node should be the <div> node");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #3 (1, 2): selection focus offset should be 1");
+  checkSelection(1, "bc", "runSetSelectionEventTest #3 (1, 2)");
 
   synthesizeSelectionSet(1, 3);
   is(selection.anchorNode, contenteditable.firstChild.firstChild,
      "runSetSelectionEventTest #3 (1, 3): selection anchor node should be the first text node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #3 (1, 3): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable.firstChild.lastChild.firstChild,
      "runSetSelectionEventTest #3 (1, 3): selection focus node should be the text node in the <p> node");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #3 (1, 3): selection focus offset should be 1");
+  checkSelection(1, "bcd", "runSetSelectionEventTest #3 (1, 3)");
 
   synthesizeSelectionSet(3, 0);
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #3 (3, 0): selection anchor node should be the <div> node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #3 (3, 0): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #3 (3, 0): selection focus node should be the <div> node");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #3 (3, 0): selection focus offset should be 1");
+  checkSelection(3, "", "runSetSelectionEventTest #3 (3, 0)");
 
   synthesizeSelectionSet(0, 6);
   is(selection.anchorNode, contenteditable.firstChild.firstChild,
      "runSetSelectionEventTest #3 (0, 6): selection anchor node should be the first text node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #3 (0, 6): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable.firstChild.lastChild,
      "runSetSelectionEventTest #3 (0, 6): selection focus node should be the <p> node");
   is(selection.focusOffset, contenteditable.firstChild.lastChild.childNodes.length,
      "runSetSelectionEventTest #3 (0, 6): selection focus offset should be the count of the <p>'s children");
+  checkSelection(0, "abcdef", "runSetSelectionEventTest #3 (0, 6)");
 
   synthesizeSelectionSet(0, 100);
   is(selection.anchorNode, contenteditable.firstChild.firstChild,
      "runSetSelectionEventTest #3 (0, 100): selection anchor node should be the first text node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #3 (0, 100): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #3 (0, 100): selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #3 (0, 100): selection focus offset should be the count of the root's children");
+  checkSelection(0, "abcdef", "runSetSelectionEventTest #3 (0, 100)");
 
   synthesizeSelectionSet(4, 2);
   is(selection.anchorNode, contenteditable.firstChild.lastChild.firstChild,
      "runSetSelectionEventTest #3 (4, 2): selection anchor node should be the text node in the <p> node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #3 (4, 2): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable.firstChild.lastChild,
      "runSetSelectionEventTest #3 (4, 2): selection focus node should be the <p> node");
   is(selection.focusOffset, contenteditable.firstChild.lastChild.childNodes.length,
      "runSetSelectionEventTest #3 (4, 2): selection focus offset should be the count of the <p>'s children");
+  checkSelection(4, "ef", "runSetSelectionEventTest #3 (4, 2)");
 
   synthesizeSelectionSet(4, 100);
   is(selection.anchorNode, contenteditable.firstChild.lastChild.firstChild,
      "runSetSelectionEventTest #3 (4, 100): selection anchor node should be the text node in the <p> node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #3 (4, 100): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #3 (4, 100): selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #3 (4, 100): selection focus offset should be the count of the root's children");
+  checkSelection(4, "ef", "runSetSelectionEventTest #3 (4, 100)");
 
   synthesizeSelectionSet(6, 0);
   is(selection.anchorNode, contenteditable.firstChild.lastChild,
      "runSetSelectionEventTest #3 (6, 0): selection anchor node should be the <p> node");
   is(selection.anchorOffset, contenteditable.firstChild.lastChild.childNodes.length,
      "runSetSelectionEventTest #3 (6, 0): selection anchor offset should be the count of the <p>'s children");
   is(selection.focusNode, contenteditable.firstChild.lastChild,
      "runSetSelectionEventTest #3 (6, 0): selection focus node should be the <p> node");
   is(selection.focusOffset, contenteditable.firstChild.lastChild.childNodes.length,
      "runSetSelectionEventTest #3 (6, 0): selection focus offset should be the count of the <p>'s children");
+  checkSelection(6, "", "runSetSelectionEventTest #3 (6, 0)");
 
   synthesizeSelectionSet(6, 1);
   todo_is(selection.anchorNode, contenteditable.firstChild.lastChild,
      "runSetSelectionEventTest #3 (6, 1): selection anchor node should be the <p> node");
   is(selection.anchorOffset, contenteditable.firstChild.lastChild.childNodes.length,
      "runSetSelectionEventTest #3 (6, 1): selection anchor offset should be the count of the <p>'s children");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #3 (6, 1): selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #3 (6, 1): selection focus offset should be the count of the root's children");
+  checkSelection(6, "", "runSetSelectionEventTest #3 (6, 1)");
 
   // #4
   contenteditable.innerHTML = "<div><p>abc</p>def</div>";
 
   synthesizeSelectionSet(1, 2);
   is(selection.anchorNode, contenteditable.firstChild.firstChild.firstChild,
      "runSetSelectionEventTest #4 (1, 2): selection anchor node should be the text node in the <p> node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #4 (1, 2): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable.firstChild.firstChild,
      "runSetSelectionEventTest #4 (1, 2): selection focus node should be the <p> node");
   is(selection.focusOffset, contenteditable.firstChild.firstChild.childNodes.length,
      "runSetSelectionEventTest #4 (1, 2): selection focus offset should be the count of the <p>'s children");
+  checkSelection(1, "bc", "runSetSelectionEventTest #4 (1, 2)");
 
   synthesizeSelectionSet(1, 3);
   is(selection.anchorNode, contenteditable.firstChild.firstChild.firstChild,
      "runSetSelectionEventTest #4 (1, 3): selection anchor node should be the text node in the <p> node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #4 (1, 3): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable.firstChild.lastChild,
      "runSetSelectionEventTest #4 (1, 3): selection focus node should be the last text node");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #4 (1, 3): selection focus offset should be 1");
+  checkSelection(1, "bcd", "runSetSelectionEventTest #4 (1, 3)");
 
   synthesizeSelectionSet(3, 0);
   is(selection.anchorNode, contenteditable.firstChild.firstChild,
      "runSetSelectionEventTest #4 (3, 0): selection anchor node should be the <p> node");
   is(selection.anchorOffset, contenteditable.firstChild.firstChild.childNodes.length,
      "runSetSelectionEventTest #4 (3, 0): selection anchor offset should be the count of <p>'s children");
   is(selection.focusNode, contenteditable.firstChild.firstChild,
      "runSetSelectionEventTest #4 (3, 0): selection focus node should be the <p> node");
   is(selection.focusOffset, contenteditable.firstChild.firstChild.childNodes.length,
      "runSetSelectionEventTest #4 (3, 0): selection focus offset should be the count of <p>'s children");
+  checkSelection(3, "", "runSetSelectionEventTest #4 (3, 0)");
 
   synthesizeSelectionSet(0, 6);
   is(selection.anchorNode, contenteditable.firstChild.firstChild.firstChild,
      "runSetSelectionEventTest #4 (0, 6): selection anchor node should be the text node in the <p> node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #4 (0, 6): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #4 (0, 6): selection focus node should be the <div> node");
   is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #4 (0, 6): selection focus offset should be the count of the <div>'s children");
+  checkSelection(0, "abcdef", "runSetSelectionEventTest #4 (0, 6)");
 
   synthesizeSelectionSet(0, 100);
   is(selection.anchorNode, contenteditable.firstChild.firstChild.firstChild,
      "runSetSelectionEventTest #4 (0, 100): selection anchor node should be the text node in the <p> node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #4 (0, 100): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #4 (0, 100): selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #4 (0, 100): selection focus offset should be the count of the root's children");
+  checkSelection(0, "abcdef", "runSetSelectionEventTest #4 (0, 100)");
 
   synthesizeSelectionSet(4, 2);
   is(selection.anchorNode, contenteditable.firstChild.lastChild,
      "runSetSelectionEventTest #4 (4, 2): selection anchor node should be the last text node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #4 (4, 2): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #4 (4, 2): selection focus node should be the <div> node");
   is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #4 (4, 2): selection focus offset should be the count of the <div>'s children");
+  checkSelection(4, "ef", "runSetSelectionEventTest #4 (4, 2)");
 
   synthesizeSelectionSet(4, 100);
   is(selection.anchorNode, contenteditable.firstChild.lastChild,
      "runSetSelectionEventTest #4 (4, 100): selection anchor node should be the last text node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #4 (4, 100): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #4 (4, 100): selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #4 (4, 100): selection focus offset should be the count of the root's children");
+  checkSelection(4, "ef", "runSetSelectionEventTest #4 (4, 100)");
 
   synthesizeSelectionSet(6, 0);
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #4 (6, 0): selection anchor node should be the <div> node");
   is(selection.anchorOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #4 (6, 0): selection anchor offset should be the count of the <div>'s children");
   is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #4 (6, 0): selection focus node should be the <div> node");
   is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #4 (6, 0): selection focus offset should be the count of the <div>'s children");
+  checkSelection(6, "", "runSetSelectionEventTest #4 (6, 0)");
 
   synthesizeSelectionSet(6, 1);
   todo_is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #4 (6, 1): selection anchor node should be the <div> node");
   todo_is(selection.anchorOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #4 (6, 1): selection anchor offset should be the count of the <div>'s children");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #4 (6, 1): selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #4 (6, 1): selection focus offset should be the count of the root's children");
+  checkSelection(6, "", "runSetSelectionEventTest #4 (6, 1)");
 
   // #5
   contenteditable.innerHTML = "<br>";
 
   synthesizeSelectionSet(0, kLFLen);
   is(selection.anchorNode, contenteditable,
      "runSetSelectionEventTest #5 (0, kLFLen): selection anchor node should be the root node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #5 (0, kLFLen): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #5 (0, kLFLen): selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #5 (0, kLFLen): selection focus offset should be the count of the root's children");
+  checkSelection(0, kLF, "runSetSelectionEventTest #5 (0, kLFLen)");
 
   synthesizeSelectionSet(kLFLen, 0);
   is(selection.anchorNode, contenteditable,
      "runSetSelectionEventTest #5 (kLFLen, 0): selection anchor node should be the root node");
   todo_is(selection.anchorOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #5 (kLFLen, 0): selection anchor offset should be the count of the root's children");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #5 (kLFLen, 0): selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #5 (kLFLen, 0): selection focus offset should be the count of the root's children");
+  // todo
+  // checkSelection(kLFLen, "", "runSetSelectionEventTest #5 (kLFLen, 0)");
 
   synthesizeSelectionSet(kLFLen, 1);
   is(selection.anchorNode, contenteditable,
      "runSetSelectionEventTest #5 (kLFLen, 1): selection anchor node should be the root node");
   is(selection.anchorOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #5 (kLFLen, 1): selection anchor offset should be the count of the root's children");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #5 (kLFLen, 1): selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #5 (kLFLen, 1): selection focus offset should be the count of the root's children");
+  checkSelection(kLFLen, "", "runSetSelectionEventTest #5 (kLFLen, 1)");
 
   // #6
   contenteditable.innerHTML = "<p><br></p>";
 
   synthesizeSelectionSet(0, kLFLen);
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #6 (0, kLFLen): selection anchor node should be the <p> node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #6 (0, kLFLen): selection anchor offset should be 1");
   todo_is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #6 (0, kLFLen): selection focus node should be the <p> node");
   is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #6 (0, kLFLen): selection focus offset should be the count of the <p>'s children");
+  checkSelection(0, kLF, "runSetSelectionEventTest #6 (0, kLFLen)");
 
   synthesizeSelectionSet(kLFLen, 0);
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #6 (kLFLen, 0): selection anchor node should be the <p> node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #6 (kLFLen, 0): selection anchor offset should be the count of the root's children");
   todo_is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #6 (kLFLen, 0): selection focus node should be the <p> node");
   is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #6 (kLFLen, 0): selection focus offset should be the count of the <p>'s children");
+  // todo
+  // checkSelection(kLFLen, "", "runSetSelectionEventTest #6 (kLFLen, 0)");
 
   synthesizeSelectionSet(kLFLen, 1);
   todo_is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #6 (kLFLen, 1): selection anchor node should be the <p> node");
   is(selection.anchorOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #6 (kLFLen, 1): selection anchor offset should be the count of the root's children");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #6 (kLFLen, 1): selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #6 (kLFLen, 1): selection focus offset should be the count of the root's children");
+  checkSelection(kLFLen, "", "runSetSelectionEventTest #6 (kLFLen, 1)");
 
   // #7
   contenteditable.innerHTML = "<br><br>";
 
   synthesizeSelectionSet(0, kLFLen);
   is(selection.anchorNode, contenteditable,
      "runSetSelectionEventTest #7 (0, kLFLen): selection anchor node should be the root node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #7 (0, kLFLen): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #7 (0, kLFLen): selection focus node should be the root node");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #7 (0, kLFLen): selection focus offset should be 1");
+  checkSelection(0, kLF, "runSetSelectionEventTest #7 (0, kLFLen)");
 
   synthesizeSelectionSet(0, kLFLen * 2);
   is(selection.anchorNode, contenteditable,
      "runSetSelectionEventTest #7 (0, kLFLen*2): selection anchor node should be the root node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #7 (0, kLFLen*2): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #7 (0, kLFLen*2): selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #7 (0, kLFLen*2): selection focus offset should be the count of the root's children");
+  checkSelection(0, kLF + kLF, "runSetSelectionEventTest #7 (0, kLFLen*2)");
 
   synthesizeSelectionSet(kLFLen, 0);
   is(selection.anchorNode, contenteditable,
      "runSetSelectionEventTest #7 (kLFLen, 0): selection anchor node should be the root node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #7 (kLFLen, 0): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #7 (kLFLen, 0): selection focus node should be the root node");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #7 (kLFLen, 0): selection focus offset should be 1");
+  checkSelection(kLFLen, "", "runSetSelectionEventTest #7 (kLFLen, 0)");
 
   synthesizeSelectionSet(kLFLen, kLFLen);
   is(selection.anchorNode, contenteditable,
      "runSetSelectionEventTest #7 (kLFLen, kLFLen): selection anchor node should be the root node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #7 (kLFLen, kLFLen): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #7 (kLFLen, kLFLen) selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #7 (kLFLen, kLFLen): selection focus offset should be the count of the root's children");
+  checkSelection(kLFLen, kLF, "runSetSelectionEventTest #7 (kLFLen, kLFLen)");
 
   synthesizeSelectionSet(kLFLen * 2, 0);
   is(selection.anchorNode, contenteditable,
      "runSetSelectionEventTest #7 (kLFLen*2, 0): selection anchor node should be the root node");
   todo_is(selection.anchorOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #7 (kLFLen*2, 0): selection anchor offset should be the count of the root's children");
   is(selection.focusNode, contenteditable,
      "runSetSelectionEventTest #7 (kLFLen*2, 0): selection focus node should be the root node");
   is(selection.focusOffset, contenteditable.childNodes.length,
      "runSetSelectionEventTest #7 (kLFLen*2, 0): selection focus offset should be the count of the root's children");
+  // todo
+  // checkSelection(kLFLen * 2, "", "runSetSelectionEventTest #7 (kLFLen*2, 0)");
 
   // #8
   contenteditable.innerHTML = "<p><br><br></p>";
 
   synthesizeSelectionSet(0, kLFLen);
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #8 (0, kLFLen): selection anchor node should be the <p> node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #8 (0, kLFLen): selection anchor offset should be 0");
   is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #8 (0, kLFLen): selection focus node should be the <p> node");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #8 (0, kLFLen): selection focus offset should be 1");
+  checkSelection(0, kLF, "runSetSelectionEventTest #7 (0, kLFLen)");
 
   synthesizeSelectionSet(0, kLFLen * 2);
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #8 (0, kLFLen*2): selection anchor node should be the <p> node");
   is(selection.anchorOffset, 0,
      "runSetSelectionEventTest #8 (0, kLFLen*2): selection anchor offset should be 0");
   todo_is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #8 (0, kLFLen*2): selection focus node should be the <p> node");
   todo_is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #8 (0, kLFLen*2): selection focus offset should be the count of the <p>'s children");
+  checkSelection(0, kLF + kLF, "runSetSelectionEventTest #8 (0, kLFLen*2)");
 
   synthesizeSelectionSet(kLFLen, 0);
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #8 (kLFLen, 0): selection anchor node should be the <p> node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #8 (kLFLen, 0): selection anchor offset should be 1");
   is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #8 (kLFLen, 0): selection focus node should be the <p> node");
   is(selection.focusOffset, 1,
      "runSetSelectionEventTest #8 (kLFLen, 0): selection focus offset should be 1");
+  checkSelection(kLFLen, "", "runSetSelectionEventTest #8 (kLFLen, 0)");
 
   synthesizeSelectionSet(kLFLen, kLFLen);
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #8 (kLFLen, kLFLen): selection anchor node should be the <p> node");
   is(selection.anchorOffset, 1,
      "runSetSelectionEventTest #8 (kLFLen, kLFLen): selection anchor offset should be 1");
   todo_is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #8 (kLFLen, kLFLen) selection focus node should be the <p> node");
   todo_is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #8 (kLFLen, kLFLen): selection focus offset should be the count of the <p>'s children");
+  checkSelection(kLFLen, kLF, "runSetSelectionEventTest #8 (kLFLen, kLFLen)");
 
   synthesizeSelectionSet(kLFLen * 2, 0);
   is(selection.anchorNode, contenteditable.firstChild,
      "runSetSelectionEventTest #8 (kLFLen*2, 0): selection anchor node should be the <p> node");
   todo_is(selection.anchorOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #8 (kLFLen*2, 0): selection anchor offset should be the count of the <p>'s children");
   todo_is(selection.focusNode, contenteditable.firstChild,
      "runSetSelectionEventTest #8 (kLFLen*2, 0): selection focus node should be the <p> node");
   todo_is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
      "runSetSelectionEventTest #8 (kLFLen*2, 0): selection focus offset should be the count of the <p>'s children");
+  // todo
+  // checkSelection(kLFLen * 2, "", "runSetSelectionEventTest #8 (kLFLen*2, 0)");
 }
 
 function runQueryTextContentEventTest()
 {
   contenteditable.focus();
 
   var result;