Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / editor / text-editor-line-breaks.html
blobf271f44a8e867048ecbe2d3d094adeba74040db5
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 InspectorTest.runTestSuite([
10 function testCRInitial(next)
12 var textEditor = InspectorTest.createTestEditor();
13 textEditor.setText("1\n2\n3\n");
14 InspectorTest.addResult(encodeURI(textEditor.text()));
15 next();
18 function testCRLFInitial(next)
20 var textEditor = InspectorTest.createTestEditor();
21 textEditor.setText("1\r\n2\r\n3\r\n");
22 InspectorTest.addResult(encodeURI(textEditor.text()));
23 next();
26 function testCREdit(next)
28 var textEditor = InspectorTest.createTestEditor();
29 textEditor.setText("1\n2\n3\n");
30 textEditor.editRange(new WebInspector.TextRange(1, 0, 1, 0), "foo\r\nbar");
31 InspectorTest.addResult(encodeURI(textEditor.text()));
32 next();
35 function testCRLFEdit(next)
37 var textEditor = InspectorTest.createTestEditor();
38 textEditor.setText("1\r\n2\r\n3\r\n");
39 textEditor.editRange(new WebInspector.TextRange(1, 0, 1, 0), "foo\r\nbar");
40 InspectorTest.addResult(encodeURI(textEditor.text()));
41 next();
43 ]);
46 </script>
47 </head>
49 <body onload="runTest()">
50 <p>
51 This test checks that line endings are inferred from the initial text content, not incremental editing.
52 </p>
54 </body>
55 </html>