| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="editor-test.js"></script> | 4 <script src="editor-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 var text = [ | 9 var text = [ |
| 10 "function foo(a, b) {", | 10 "function foo(a, b) {", |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 var column = columns[j]; | 28 var column = columns[j]; |
| 29 InspectorTest.addResult("Column #" + column + " (char '" + text[
i].charAt(column) + "') - token: " + JSON.stringify(textEditor.tokenAtTextPositi
on(i, column))); | 29 InspectorTest.addResult("Column #" + column + " (char '" + text[
i].charAt(column) + "') - token: " + JSON.stringify(textEditor.tokenAtTextPositi
on(i, column))); |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 | 33 |
| 34 InspectorTest.runTestSuite([ | 34 InspectorTest.runTestSuite([ |
| 35 function testHighlightedText(next) | 35 function testHighlightedText(next) |
| 36 { | 36 { |
| 37 var textEditor = InspectorTest.createTestEditor(); | 37 var textEditor = InspectorTest.createTestEditor(); |
| 38 textEditor.setMimeType("text/javascript").then(step1); | 38 InspectorTest.addSnifferPromise(SourceFrame.SourcesTextEditor.protot
ype, "rewriteMimeType").then(step1); |
| 39 textEditor.setMimeType("text/javascript"); |
| 39 function step1() | 40 function step1() |
| 40 { | 41 { |
| 41 textEditor.setText(text.join("\n")); | 42 textEditor.setText(text.join("\n")); |
| 42 testTokenAtPosition(textEditor); | 43 testTokenAtPosition(textEditor); |
| 43 next(); | 44 next(); |
| 44 } | 45 } |
| 45 }, | 46 }, |
| 46 ]); | 47 ]); |
| 47 } | 48 } |
| 48 | 49 |
| 49 </script> | 50 </script> |
| 50 </head> | 51 </head> |
| 51 | 52 |
| 52 <body onload="runTest()"> | 53 <body onload="runTest()"> |
| 53 <p> | 54 <p> |
| 54 Test editor tokenAtTextPosition method. | 55 Test editor tokenAtTextPosition method. |
| 55 </p> | 56 </p> |
| 56 </body> | 57 </body> |
| 57 </html> | 58 </html> |
| OLD | NEW |