| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script> |
| 6 |
| 7 function logToConsole() |
| 8 { |
| 9 var obj = {a: 1, b: "foo", c: null}; |
| 10 console.log(obj); |
| 11 } |
| 12 |
| 13 var test = function() |
| 14 { |
| 15 InspectorTest.evaluateInConsole("logToConsole()", step1); |
| 16 |
| 17 function step1() |
| 18 { |
| 19 InspectorTest.expandConsoleMessages(step2); |
| 20 } |
| 21 |
| 22 function step2() |
| 23 { |
| 24 var valueElements = getValueElements(); |
| 25 doubleClickTypeAndEnter(valueElements[0], "1 + 2"); |
| 26 InspectorTest.waitForRemoteObjectsConsoleMessages(step3); |
| 27 } |
| 28 |
| 29 function step3() |
| 30 { |
| 31 var valueElements = getValueElements(); |
| 32 doubleClickTypeAndEnter(valueElements[1], "nonExistingValue"); |
| 33 InspectorTest.waitForRemoteObjectsConsoleMessages(step4); |
| 34 } |
| 35 |
| 36 function step4() |
| 37 { |
| 38 var valueElements = getValueElements(); |
| 39 doubleClickTypeAndEnter(valueElements[2], "[1, 2, 3]"); |
| 40 InspectorTest.waitForRemoteObjectsConsoleMessages(step5); |
| 41 } |
| 42 |
| 43 function step5() |
| 44 { |
| 45 InspectorTest.dumpConsoleMessagesIgnoreErrorStackFrames(); |
| 46 InspectorTest.completeTest(); |
| 47 } |
| 48 |
| 49 function getValueElements() |
| 50 { |
| 51 var messageElement = WebInspector.ConsoleView.instance()._visibleViewMes
sages[1]._messageElement; |
| 52 return messageElement.querySelectorAll("::shadow .value"); |
| 53 } |
| 54 |
| 55 function doubleClickTypeAndEnter(node, text) |
| 56 { |
| 57 var event = document.createEvent("MouseEvent"); |
| 58 event.initMouseEvent("dblclick", true, true, null, 2); |
| 59 node.dispatchEvent(event); |
| 60 |
| 61 InspectorTest.addResult("Node was hidden after dblclick: " + node.classL
ist.contains("hidden")); |
| 62 |
| 63 var messageElement = WebInspector.ConsoleView.instance()._visibleViewMes
sages[1]._messageElement; |
| 64 var editPrompt = messageElement.querySelector("::shadow .text-prompt"); |
| 65 editPrompt.textContent = text; |
| 66 editPrompt.dispatchEvent(InspectorTest.createKeyEvent("Enter")); |
| 67 } |
| 68 } |
| 69 |
| 70 </script> |
| 71 </head> |
| 72 |
| 73 <body onload="runTest()"> |
| 74 <p> |
| 75 Tests that property values can be edited inline in the console via double click. |
| 76 </p> |
| 77 |
| 78 </body> |
| 79 </html> |
| OLD | NEW |