| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/console-test.js"></script> | 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function populateConsoleWithMessages(count) | 6 function populateConsoleWithMessages(count) |
| 7 { | 7 { |
| 8 for (var i = 0; i < count - 1; ++i) | 8 for (var i = 0; i < count - 1; ++i) |
| 9 console.log("Multiline\nMessage #" + i); | 9 console.log("Multiline\nMessage #" + i); |
| 10 console.log("hello %cworld", "color: blue"); | 10 console.log("hello %cworld", "color: blue"); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } | 70 } |
| 71 }, | 71 }, |
| 72 | 72 |
| 73 function testEscShouldNotJumpToBottom(next) | 73 function testEscShouldNotJumpToBottom(next) |
| 74 { | 74 { |
| 75 var keyEvent = InspectorTest.createKeyEvent("Escape"); | 75 var keyEvent = InspectorTest.createKeyEvent("Escape"); |
| 76 viewport._contentElement.dispatchEvent(keyEvent); | 76 viewport._contentElement.dispatchEvent(keyEvent); |
| 77 dumpAndContinue(next); | 77 dumpAndContinue(next); |
| 78 }, | 78 }, |
| 79 | 79 |
| 80 function testTypingShouldJumpToBottom(next) | 80 function testChangingPromptTextShouldJumpToBottom(next) |
| 81 { | 81 { |
| 82 var keyEvent = InspectorTest.createKeyEvent("a"); | 82 InspectorTest.addSniffer(Console.ConsoleView.prototype, "_promptText
ChangedForTest", onContentChanged); |
| 83 viewport._contentElement.dispatchEvent(keyEvent); | 83 var editorElement = consoleView._prompt.setText("a"); |
| 84 consoleView._promptElement.dispatchEvent(new Event('input')); | |
| 85 | 84 |
| 86 dumpAndContinue(next); | 85 function onContentChanged() { |
| 86 dumpAndContinue(next); |
| 87 } |
| 87 }, | 88 }, |
| 88 | 89 |
| 89 function testViewportMutationsShouldPreserveStickToBottom(next) | 90 function testViewportMutationsShouldPreserveStickToBottom(next) |
| 90 { | 91 { |
| 91 viewport._contentElement.lastChild.innerText = "More than 2 lines: f
oo\n\nbar"; | 92 viewport._contentElement.lastChild.innerText = "More than 2 lines: f
oo\n\nbar"; |
| 92 dumpAndContinue(onMessagesDumped); | 93 dumpAndContinue(onMessagesDumped); |
| 93 | 94 |
| 94 function onMessagesDumped() | 95 function onMessagesDumped() |
| 95 { | 96 { |
| 96 viewport.setStickToBottom(false); | 97 viewport.setStickToBottom(false); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } | 180 } |
| 180 } | 181 } |
| 181 </script> | 182 </script> |
| 182 </head> | 183 </head> |
| 183 <body onload="runTest()"> | 184 <body onload="runTest()"> |
| 184 <p> | 185 <p> |
| 185 Verifies viewport stick-to-bottom behavior. | 186 Verifies viewport stick-to-bottom behavior. |
| 186 </p> | 187 </p> |
| 187 </body> | 188 </body> |
| 188 </html> | 189 </html> |
| OLD | NEW |