Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / editor / text-editor-mark-clean.html
blobf004937970e3a32b6623d1bfe4ae570efec075f5
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 var textEditor = InspectorTest.createTestEditor();
10 textEditor.setText("1\n2\n3\n4");
12 InspectorTest.runTestSuite([
13 function testMarkiningInitialStateAsClean(next)
15 InspectorTest.addResult("Initial state: clean=" + textEditor.isClean());
16 textEditor.markClean();
17 InspectorTest.addResult("After marking clean: clean=" + textEditor.isClean());
18 textEditor.editRange(WebInspector.TextRange.createFromLocation(0, 0), "newText");
19 InspectorTest.addResult("EDIT; clean=" + textEditor.isClean());
20 textEditor.undo();
21 InspectorTest.addResult("UNDO; clean=" + textEditor.isClean());
22 textEditor.redo();
23 InspectorTest.addResult("REDO; clean=" + textEditor.isClean());
24 textEditor.undo();
25 InspectorTest.addResult("UNDO; clean=" + textEditor.isClean());
26 textEditor.editRange(WebInspector.TextRange.createFromLocation(1, 0), "newText2");
27 InspectorTest.addResult("EDIT; clean=" + textEditor.isClean());
28 textEditor.undo();
29 InspectorTest.addResult("UNDO; clean=" + textEditor.isClean());
30 next();
33 function testMiddleStateAsClean(next)
35 InspectorTest.addResult("Initial state: clean=" + textEditor.isClean());
36 for(var i = 0; i < 3; ++i) {
37 textEditor.editRange(WebInspector.TextRange.createFromLocation(i, 0), "newText" + i);
38 InspectorTest.addResult("EDIT; clean=" + textEditor.isClean());
40 textEditor.markClean();
41 InspectorTest.addResult("After marking clean: clean=" + textEditor.isClean());
42 textEditor.editRange(WebInspector.TextRange.createFromLocation(3, 0), "newText" + 3);
43 InspectorTest.addResult("EDIT; clean=" + textEditor.isClean());
44 for(var i = 0; i < 4; ++i) {
45 textEditor.undo();
46 InspectorTest.addResult("UNDO; clean=" + textEditor.isClean());
48 for(var i = 0; i < 4; ++i) {
49 textEditor.redo();
50 InspectorTest.addResult("REDO; clean=" + textEditor.isClean());
52 for(var i = 0; i < 2; ++i) {
53 textEditor.undo();
54 InspectorTest.addResult("UNDO; clean=" + textEditor.isClean());
56 textEditor.editRange(WebInspector.TextRange.createFromLocation(1, 0), "foo");
57 InspectorTest.addResult("EDIT; clean=" + textEditor.isClean());
58 textEditor.undo();
59 InspectorTest.addResult("UNDO; clean=" + textEditor.isClean());
60 textEditor.undo();
61 InspectorTest.addResult("UNDO; clean=" + textEditor.isClean());
62 next();
64 ]);
67 </script>
68 </head>
70 <body onload="runTest()">
71 <p>
72 This test checks TextEditorModel.markClean/isClean methods
73 </p>
75 </body>
76 </html>