Add more Avatar tests.

This commit is contained in:
Jos van den Oever
2012-08-30 08:36:10 +02:00
parent 9b4e315cd0
commit c8b052dfb4
2 changed files with 22 additions and 5 deletions
+22 -4
View File
@@ -85,19 +85,37 @@ gui.AvatarTests = function AvatarTests(runner) {
s = c.getSelection(),
i;
t.startNode = s.focusNode;
for (i = 1; i <= 5; i += 1) {
for (i = 1; i <= 4; i += 1) {
c.move(1);
t.focusOffset = s.focusOffset;
t.focusNode = s.focusNode;
r.shouldBe(t, "t.focusOffset", i.toString());
r.shouldBe(t, "t.startNode", "t.focusNode");
r.shouldBe(t, "t.focusNode", "t.startNode");
}
c.move(1);
t.focusOffset = s.focusOffset;
t.focusNode = s.focusNode;
r.shouldBe(t, "t.focusOffset", "1");
r.shouldBe(t, "t.focusNode", "t.startNode.parentNode");
c.move(1);
r.shouldBe(t, "t.focusOffset", "1");
r.shouldBe(t, "t.focusNode", "t.startNode.parentNode");
for (i = 4; i >= 0; i -= 1) {
c.move(-1);
t.focusOffset = s.focusOffset;
t.focusNode = s.focusNode;
r.shouldBe(t, "t.focusOffset", i.toString());
r.shouldBe(t, "t.focusNode", "t.startNode");
}
c.move(1);
r.shouldBe(t, "t.focusOffset", "0");
r.shouldBe(t, "t.focusNode", "t.startNode");
}
this.tests = function () {
return [
create,
moveInEmptyDoc/*,
moveInSimpleDoc*/
moveInEmptyDoc,
moveInSimpleDoc
];
};
this.asyncTests = function () {
-1
View File
@@ -57,7 +57,6 @@ if (runtime.getDOMImplementation() && runtime.parseXML("<a/>").createRange) {
}
if (runtime.type() === "BrowserRuntime") {
tests.push(gui.CaretTests);
tests.push(gui.AvatarTests);
tests.push(xmldom.OperationalTransformDOMTests);
tests.push(xmldom.XPathTests);
// tests.push(core.CursorTests);