3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"editor-test.js"></script>
10 "function foo(a, b) {",
11 " var f = /.a/.test(a); /*",
12 "this is a comment */",
13 " return f + \"looongword\";"
22 function testTokenAtPosition(textEditor
)
24 for(var i
= 0; i
< positions
.length
; ++i
) {
25 var columns
= positions
[i
];
26 InspectorTest
.addResult("Line: " + text
[i
]);
27 for(var j
= 0; j
< columns
.length
; ++j
) {
28 var column
= columns
[j
];
29 InspectorTest
.addResult("Column #" + column
+ " (char '" + text
[i
].charAt(column
) + "') - token: " + JSON
.stringify(textEditor
.tokenAtTextPosition(i
, column
)));
34 InspectorTest
.runTestSuite([
35 function testHighlightedText(next
)
37 var textEditor
= InspectorTest
.createTestEditor();
38 textEditor
.setMimeType("text/javascript");
39 textEditor
.setText(text
.join("\n"));
40 testTokenAtPosition(textEditor
);
49 <body onload=
"runTest()">
51 Test editor tokenAtTextPosition method.