blob: f271f44a8e867048ecbe2d3d094adeba74040db5 [file] [log] [blame]
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="editor-test.js"></script>
<script>
function test()
{
InspectorTest.runTestSuite([
function testCRInitial(next)
{
var textEditor = InspectorTest.createTestEditor();
textEditor.setText("1\n2\n3\n");
InspectorTest.addResult(encodeURI(textEditor.text()));
next();
},
function testCRLFInitial(next)
{
var textEditor = InspectorTest.createTestEditor();
textEditor.setText("1\r\n2\r\n3\r\n");
InspectorTest.addResult(encodeURI(textEditor.text()));
next();
},
function testCREdit(next)
{
var textEditor = InspectorTest.createTestEditor();
textEditor.setText("1\n2\n3\n");
textEditor.editRange(new WebInspector.TextRange(1, 0, 1, 0), "foo\r\nbar");
InspectorTest.addResult(encodeURI(textEditor.text()));
next();
},
function testCRLFEdit(next)
{
var textEditor = InspectorTest.createTestEditor();
textEditor.setText("1\r\n2\r\n3\r\n");
textEditor.editRange(new WebInspector.TextRange(1, 0, 1, 0), "foo\r\nbar");
InspectorTest.addResult(encodeURI(textEditor.text()));
next();
}
]);
}
</script>
</head>
<body onload="runTest()">
<p>
This test checks that line endings are inferred from the initial text content, not incremental editing.
</p>
</body>
</html>