3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"editor-test.js"></script>
8 var out
= InspectorTest
.addResult
;
9 var textEditor
= InspectorTest
.createTestEditor(500);
10 textEditor
.setMimeType("text/javascript");
11 textEditor
.setReadOnly(false);
12 textEditor
.element
.focus();
14 textEditor
.setText(new Array(10000).join("\n"));
24 testLineReveal(textEditor
.linesCount
);
26 testLineReveal(10100);
28 function testLineReveal(lineNumber
)
30 textEditor
.revealPosition(lineNumber
);
31 var firstLine
= textEditor
.firstVisibleLine();
32 var lastLine
= textEditor
.lastVisibleLine();
33 var lineCentered
= Math
.abs(2 * lineNumber
- firstLine
- lastLine
) <= 1;
34 out("======= Revealing line: " + lineNumber
);
35 out(" is line centered: " + lineCentered
);
38 InspectorTest
.completeTest();
44 <body onload=
"runTest()">
46 This test checks that text editor's revealLine centers line where needed.