Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 var initialize_InspectorTest = function() { | 1 var initialize_InspectorTest = function() { |
| 2 | 2 |
| 3 var results = []; | 3 var results = []; |
| 4 var resultsSynchronized = false; | 4 var resultsSynchronized = false; |
| 5 | 5 |
| 6 function consoleOutputHook(messageType) | 6 function consoleOutputHook(messageType) |
| 7 { | 7 { |
| 8 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu ments, 1)); | 8 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu ments, 1)); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 | 44 |
| 45 InspectorTest.evaluateInConsole = function(code, callback) | 45 InspectorTest.evaluateInConsole = function(code, callback) |
| 46 { | 46 { |
| 47 callback = InspectorTest.safeWrap(callback); | 47 callback = InspectorTest.safeWrap(callback); |
| 48 | 48 |
| 49 WebInspector.consoleView.visible = true; | 49 WebInspector.consoleView.visible = true; |
| 50 WebInspector.consoleView.prompt.text = code; | 50 WebInspector.consoleView.prompt.text = code; |
| 51 var event = document.createEvent("KeyboardEvent"); | 51 var event = document.createEvent("KeyboardEvent"); |
| 52 event.initKeyboardEvent("keydown", true, true, null, "Enter", ""); | 52 event.initKeyboardEvent("keydown", true, true, null, "Enter", ""); |
| 53 WebInspector.consoleView.prompt.proxyElement.dispatchEvent(event); | 53 WebInspector.consoleView.prompt.proxyElement.dispatchEvent(event); |
| 54 InspectorTest.addConsoleSniffer( | 54 function sniffer(commandResult) { |
| 55 function(commandResult) { | 55 if (commandResult.type === "result") |
| 56 callback(commandResult.toMessageElement().textContent); | 56 callback(commandResult.toMessageElement().textContent); |
| 57 }); | 57 else |
| 58 InspectorTest.addConsoleSniffer(sniffer); | |
|
pfeldman
2013/12/05 17:29:54
You can't add a sniffer from within sniffer callba
| |
| 59 } | |
| 60 | |
| 61 InspectorTest.addConsoleSniffer(sniffer); | |
| 58 } | 62 } |
| 59 | 63 |
| 60 InspectorTest.evaluateInConsoleAndDump = function(code, callback) | 64 InspectorTest.evaluateInConsoleAndDump = function(code, callback) |
| 61 { | 65 { |
| 62 callback = InspectorTest.safeWrap(callback); | 66 callback = InspectorTest.safeWrap(callback); |
| 63 | 67 |
| 64 function mycallback(text) | 68 function mycallback(text) |
| 65 { | 69 { |
| 66 InspectorTest.addResult(code + " = " + text); | 70 InspectorTest.addResult(code + " = " + text); |
| 67 callback(text); | 71 callback(text); |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 634 evaluateInWebInspector: function(callId, script) | 638 evaluateInWebInspector: function(callId, script) |
| 635 { | 639 { |
| 636 window.opener.postMessage(["evaluateInWebInspector", callId, script], "* "); | 640 window.opener.postMessage(["evaluateInWebInspector", callId, script], "* "); |
| 637 }, | 641 }, |
| 638 | 642 |
| 639 display: function() { } | 643 display: function() { } |
| 640 } | 644 } |
| 641 | 645 |
| 642 if (!window.testRunner && window.opener) | 646 if (!window.testRunner && window.opener) |
| 643 window.testRunner = new StandaloneTestRunnerStub(); | 647 window.testRunner = new StandaloneTestRunnerStub(); |
| OLD | NEW |