Web Inspector: show whitespace characters in DTE
[WebKit-https.git] / LayoutTests / inspector / editor / text-editor-show-whitespace.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="editor-test.js"></script>
5 <script>
6 function test()
7 {
8 function foo(a, b) {
9     // spaces in comment
10     a = "string with spaces";
11     a = 2;               a = 3;
12 }
13
14     WebInspector.settings.showWhitespaceInEditor.set(false);
15     var textEditor = InspectorTest.createTestEditor();
16     textEditor.overrideViewportForTest(0, undefined, 3);
17     textEditor.mimeType = "text/javascript";
18     textEditor.setText(foo.toString());
19     InspectorTest.addResult("Actual text:");
20     InspectorTest.addResult(textEditor.text());
21     InspectorTest.addResult("========== Editor HTML showWhitespaceInEditor OFF ==========");
22     InspectorTest.dumpEditorHTML(textEditor, true);
23     WebInspector.settings.showWhitespaceInEditor.set(true);
24     InspectorTest.addResult("========== Editor HTML after setting showWhitespaceInEditor ON ==========");
25     InspectorTest.dumpEditorHTML(textEditor, true);
26     InspectorTest.completeTest();
27 }
28
29 </script>
30 </head>
31
32 <body onload="runTest();">
33 <p>
34 This test checks how text editor splits whitespace sequences to highlight them if the appropriate
35 setting is set up.
36 </p>
37 </body>
38 </html>