Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / editor / text-editor-token-at-position.html
blob6a240a93c1aa5bfd511e038b9eab31bf985974c5
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="editor-test.js"></script>
5 <script>
7 function test()
9 var text = [
10 "function foo(a, b) {",
11 " var f = /.a/.test(a); /*",
12 "this is a comment */",
13 " return f + \"looongword\";"
16 var positions = [
17 [0, 10, 13],
18 [8, 14, 19],
19 [0, 5],
20 [5, 20]
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);
41 next();
43 ]);
46 </script>
47 </head>
49 <body onload="runTest()">
50 <p>
51 Test editor tokenAtTextPosition method.
52 </p>
53 </body>
54 </html>