blob: bc7492168953dd5b2efcd77ad0331ac0c385a25b [file] [log] [blame]
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script>
function test()
{
InspectorTest.runTestSuite([
function testCRInitial(next)
{
var textModel = new WebInspector.TextEditorModel();
textModel.setText("1\n2\n3\n");
InspectorTest.addResult(encodeURI(textModel.text()));
next();
},
function testCRLFInitial(next)
{
var textModel = new WebInspector.TextEditorModel();
textModel.setText("1\r\n2\r\n3\r\n");
InspectorTest.addResult(encodeURI(textModel.text()));
next();
},
function testCREdit(next)
{
var textModel = new WebInspector.TextEditorModel();
textModel.setText("1\n2\n3\n");
textModel.editRange(new WebInspector.TextRange(1, 0, 1, 0), "foo\r\nbar");
InspectorTest.addResult(encodeURI(textModel.text()));
next();
},
function testCRLFEdit(next)
{
var textModel = new WebInspector.TextEditorModel();
textModel.setText("1\r\n2\r\n3\r\n");
textModel.editRange(new WebInspector.TextRange(1, 0, 1, 0), "foo\r\nbar");
InspectorTest.addResult(encodeURI(textModel.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>