Changeset 80416 in webkit
- Timestamp:
- Mar 5, 2011 2:09:35 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 1 deleted
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r80413 r80416 1 2011-03-04 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: fix layout tests flakiness. 6 https://bugs.webkit.org/show_bug.cgi?id=55816 7 8 - Timeline now uses instrumentation calls, not UI representation while collecting events for tests 9 - No reloads in debugger tests that don't need them 10 - Forcing layout in timeline via calculating offsetHeight 11 12 * http/tests/inspector/inspector-test.js: 13 * inspector/console/console-uncaught-exception-expected.txt: 14 * inspector/console/console-uncaught-exception.html: 15 * inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt: 16 * inspector/debugger/debugger-autocontinue-on-syntax-error.html: 17 * inspector/debugger/resources/syntax-error.html: Added. 18 * inspector/debugger/resources/syntax-error.js: Removed. 19 * inspector/elements/elements-panel-limited-children-expected.txt: 20 * inspector/extensions/extensions-events-expected.txt: 21 * inspector/styles/styles-update-from-js-expected.txt: 22 * inspector/styles/styles-update-from-js.html: 23 * inspector/timeline/timeline-layout.html: 24 * inspector/timeline/timeline-network-resource-expected.txt: 25 * inspector/timeline/timeline-network-resource.html: 26 * inspector/timeline/timeline-script-tag-1.html: 27 * inspector/timeline/timeline-script-tag-2.html: 28 * inspector/timeline/timeline-test.js: 29 (initialize_Timeline.InspectorTest.startTimeline.addRecord): 30 (initialize_Timeline.InspectorTest.startTimeline): 31 (initialize_Timeline.InspectorTest.stopTimeline): 32 (initialize_Timeline.InspectorTest.performActionsAndPrint.step2): 33 (initialize_Timeline.InspectorTest.performActionsAndPrint): 34 (initialize_Timeline.InspectorTest.printTimelineRecords): 35 * inspector/timeline/timeline-trivial.html: 36 * platform/chromium/inspector/timeline/timeline-network-resource-expected.txt: 37 1 38 2011-03-05 Csaba Osztrogonác <ossy@webkit.org> 2 39 -
trunk/LayoutTests/http/tests/inspector/inspector-test.js
r80373 r80416 277 277 } 278 278 279 WebInspector.showPanel(" elements");279 WebInspector.showPanel("console"); 280 280 try { 281 281 testFunction(); … … 329 329 { 330 330 if (!outputElement) { 331 var intermediate = document.createElement("div"); 332 document.body.appendChild(intermediate); 333 334 var intermediate2 = document.createElement("div"); 335 intermediate.appendChild(intermediate2); 336 331 337 outputElement = document.createElement("div"); 332 338 outputElement.className = "output"; 333 339 outputElement.style.whiteSpace = "pre"; 334 document.body.appendChild(outputElement);340 intermediate2.appendChild(outputElement); 335 341 } 336 342 outputElement.appendChild(document.createTextNode(text)); -
trunk/LayoutTests/inspector/audits/audits-panel-functional.html
r80061 r80416 17 17 var test = function() 18 18 { 19 WebInspector.showPanel("elements"); 20 19 21 InspectorTest.reloadPage(step1); 20 22 … … 31 33 32 34 InspectorTest.runAfterPendingDispatches(step2); 33 } 35 } 34 36 35 37 function step2() -
trunk/LayoutTests/inspector/console/console-uncaught-exception-expected.txt
r78535 r80416 1 CONSOLE MESSAGE: line 35: Error: Exception in inline script. 2 CONSOLE MESSAGE: line 19: Error: Exception in 'load' event listener. 3 CONSOLE MESSAGE: line 27: Error: Exception in setTimeout callback. 4 CONSOLE MESSAGE: line 35: Error: Exception in inline script. 5 CONSOLE MESSAGE: line 19: Error: Exception in 'load' event listener. 6 CONSOLE MESSAGE: line 27: Error: Exception in setTimeout callback. 1 CONSOLE MESSAGE: line 18: Error: Exception in inline script. 2 CONSOLE MESSAGE: line 11: Error: Exception in 'load' event listener. 3 CONSOLE MESSAGE: line 6: Error: Exception in setTimeout callback. 7 4 Tests that uncaught exceptions are logged into console.Bug 47250. 8 5 9 Page reloaded.10 console-uncaught-exception.html:35Error: Exception in inline script.11 console-uncaught-exception.html:19Error: Exception in 'load' event listener.12 console-uncaught-exception.html:27Error: Exception in setTimeout callback.13 6 7 uncaught-in-iframe.html:18Error: Exception in inline script. 8 uncaught-in-iframe.html:11Error: Exception in 'load' event listener. 9 uncaught-in-iframe.html:6Error: Exception in setTimeout callback. 10 -
trunk/LayoutTests/inspector/console/console-uncaught-exception.html
r78535 r80416 5 5 <script> 6 6 7 8 7 function test() 9 8 { 10 InspectorTest.reloadPage(function() { 11 InspectorTest.expandConsoleMessages(); 12 InspectorTest.dumpConsoleMessages(); 13 InspectorTest.completeTest(); 14 }); 9 InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", addMessage, true); 10 InspectorTest.evaluateInPage("loadIframe()"); 11 function addMessage(message) 12 { 13 if (message.toString().indexOf("setTimeout") !== -1) { 14 InspectorTest.expandConsoleMessages(); 15 InspectorTest.dumpConsoleMessages(); 16 InspectorTest.completeTest(); 17 } 18 } 15 19 } 16 20 17 window.addEventListener("load", function(e) { 18 function f() { 19 throw new Error("Exception in 'load' event listener.") 20 } 21 f(); 22 }, false); 23 24 25 setTimeout(function() { 26 function bar() { 27 throw new Error("Exception in setTimeout callback."); 28 } 29 bar(); 30 }, 0); 31 32 33 function a() 21 function loadIframe() 34 22 { 35 throw new Error("Exception in inline script.") 23 var iframe = document.createElement("iframe"); 24 iframe.src = "resources/uncaught-in-iframe.html"; 25 document.body.appendChild(iframe); 36 26 } 37 38 function b()39 {40 a();41 }42 43 b();44 27 45 28 </script> -
trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt
r78535 r80416 1 CONSOLE MESSAGE: line 1: SyntaxError: Parse error2 CONSOLE MESSAGE: line 1: SyntaxError: Parse error1 CONSOLE MESSAGE: line 4: SyntaxError: Parse error 2 CONSOLE MESSAGE: line 8: Iframe loaded 3 3 Tests that debugger won't stop on syntax errors even if "pause on uncaught exceptions" is on. 4 4 5 5 Debugger was enabled. 6 Page reloaded.7 6 Debugger was disabled. 8 7 -
trunk/LayoutTests/inspector/debugger/debugger-autocontinue-on-syntax-error.html
r78717 r80416 3 3 <script src="../../http/tests/inspector/inspector-test.js"></script> 4 4 <script src="../../http/tests/inspector/debugger-test.js"></script> 5 <script src="resources/syntax-error.js"></script>6 5 <script> 6 7 function loadIframe() 8 { 9 var iframe = document.createElement("iframe"); 10 iframe.src = "resources/syntax-error.html"; 11 document.body.appendChild(iframe); 12 } 7 13 8 14 function test() 9 15 { 10 16 WebInspector.showPanel("scripts"); 11 InspectorTest.startDebuggerTest(st artDebuggerTestCallback);17 InspectorTest.startDebuggerTest(step1); 12 18 13 function st artDebuggerTestCallback()19 function step1() 14 20 { 15 21 DebuggerAgent.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions); 16 InspectorTest.showScriptSource("debugger-autocontinue-on-syntax-error.html", reloadInspectedPage); 22 InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2); 23 InspectorTest.evaluateInPage("loadIframe()"); 17 24 } 18 25 19 function reloadInspectedPage()26 function step2() 20 27 { 21 InspectorTest.reloadPage(function() { 22 InspectorTest.completeDebuggerTest(); 23 }); 28 InspectorTest.completeDebuggerTest(); 24 29 } 25 26 30 } 27 31 -
trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html
r78535 r80416 7 7 function test() 8 8 { 9 9 WebInspector.showPanel("elements"); 10 10 InspectorTest.selectNodeWithId("inspected", step1); 11 11 12 function step1( )12 function step1(node) 13 13 { 14 14 InspectorTest.addResult("Before style property removal:"); 15 15 InspectorTest.dumpSelectedElementStyles(true); 16 17 var treeElement; 18 var innerMapping = WebInspector.domAgent._idToDOMNode; 19 for (var nodeId in innerMapping) { 20 if (innerMapping[nodeId].nodeName === "DIV") { 21 treeElement = WebInspector.panels.elements.treeOutline.findTreeElement(innerMapping[nodeId]); 22 break; 23 } 24 } 25 var styleAttrElement = treeElement.listItemElement.getElementsByClassName("webkit-html-attribute")[1]; 26 treeElement._startEditingTarget(styleAttrElement); 27 var editorElement = window.getSelection().anchorNode.parentElement; 28 29 // Remove the "style" attribute altogether (not just clear its value). 30 editorElement.textContent = ""; 31 editorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); 16 node.removeAttribute("style"); 32 17 InspectorTest.runAfterPendingDispatches(step2); 33 18 } -
trunk/LayoutTests/inspector/elements/elements-panel-limited-children-expected.txt
r78576 r80416 38 38 </div> 39 39 <p>Tests that src and href element targets are rewritten properly.</p> 40 + <div class="output" style="white-space: pre; ">…</div>40 + <div>…</div> 41 41 </body> 42 42 </html> … … 59 59 </div> 60 60 <p>Tests that src and href element targets are rewritten properly.</p> 61 + <div class="output" style="white-space: pre; ">…</div>61 + <div>…</div> 62 62 </body> 63 63 </html> -
trunk/LayoutTests/inspector/elements/elements-panel-search.html
r80204 r80416 6 6 function test() 7 7 { 8 WebInspector.showPanel("elements"); 9 8 10 var searchResults = []; 9 11 function addSearchResult(markupValue) -
trunk/LayoutTests/inspector/extensions/extensions-events-expected.txt
r78535 r80416 6 6 onFinished fired 7 7 RUNNING TEST: extension_testPageLoadEvents 8 Page reloaded. 8 9 onDOMContentLoaded fired: number 9 10 onLoaded fired: number 10 Page reloaded.11 11 All tests done. 12 12 -
trunk/LayoutTests/inspector/styles/styles-add-blank-property.html
r78535 r80416 7 7 function test() 8 8 { 9 WebInspector.showPanel("elements"); 9 10 InspectorTest.selectNodeWithId("inspected", step1); 10 11 -
trunk/LayoutTests/inspector/styles/styles-update-from-js-expected.txt
r79009 r80416 1 1 Tests that changes to an inline style from JavaScript are reflected in the Styles pane and Elements tree. 2 2 3 'style' attribute modified: 3 4 Running: testInit 5 6 Running: testSetStyleAttribute 4 7 <div id="container" style="color: #daC0DE; border: 1px solid black;"></div> 5 8 [expanded] element.style { () … … 20 23 21 24 22 cssText modified: 25 26 Running: testSetStyleCSSText 23 27 <div id="container" style="color: rgb(192, 255, 238); "></div> 24 28 [expanded] element.style { () … … 26 30 27 31 28 parsed attributes modified: 32 33 Running: testSetViaParsedAttributes 29 34 <div id="container" style="color: rgb(192, 255, 238); border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: green; border-right-color: green; border-bottom-color: green; border-left-color: green; border-top-width: 3px; border-right-width: 3px; border-bottom-width: 3px; border-left-width: 3px; "></div> 30 35 [expanded] element.style { () -
trunk/LayoutTests/inspector/styles/styles-update-from-js.html
r79205 r80416 9 9 } 10 10 11 function modifyC ssText()11 function modifyCSSText() 12 12 { 13 13 document.getElementById("container").style.cssText = "color: #C0FFEE"; … … 23 23 function test() 24 24 { 25 InspectorTest. selectNodeWithId("container", step0);25 InspectorTest.runTestSuite([ 26 26 27 // Set style via "style" attribute. 28 function step0() 29 { 30 InspectorTest.evaluateInPage("modifyStyleAttribute()"); 31 InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1); 32 } 27 function testInit(next) 28 { 29 InspectorTest.selectNodeWithId("container", next); 30 }, 33 31 34 // Set style via cssText. 35 function step1() 36 { 37 InspectorTest.addResult("'style' attribute modified:"); 38 dumpAttributeAndStyles(); 32 function testSetStyleAttribute(next) 33 { 34 var updateCount = 0; 35 function callback() 36 { 37 // Expect two updates while setting attribute. 38 if (++updateCount === 2) { 39 dumpAttributeAndStyles(); 40 next(); 41 } 42 } 43 InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", callback, true); 44 InspectorTest.evaluateInPage("modifyStyleAttribute()"); 45 }, 39 46 40 // Inhibit the second Styles pane update from step0(). 41 function callback() 47 function testSetStyleCSSText(next) 42 48 { 43 InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2); 49 var updateCount = 0; 50 function callback() 51 { 52 // Expect two updates while setting css text. 53 if (++updateCount === 2) { 54 dumpAttributeAndStyles(); 55 next(); 56 } 57 } 58 InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", callback, true); 59 InspectorTest.evaluateInPage("modifyCSSText()", callback); 60 }, 61 62 function testSetViaParsedAttributes(next) 63 { 64 function callback() 65 { 66 dumpAttributeAndStyles(); 67 next(); 68 } 69 InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", callback); 70 InspectorTest.evaluateInPage("modifyParsedAttributes()"); 44 71 } 45 46 InspectorTest.evaluateInPage("modifyCssText()", callback); 47 } 48 49 // Set style via parsed attributes. 50 function step2() 51 { 52 InspectorTest.addResult("cssText modified:"); 53 dumpAttributeAndStyles(); 54 55 InspectorTest.evaluateInPage("modifyParsedAttributes()"); 56 InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3); 57 } 58 59 // Finish the test. 60 function step3() 61 { 62 InspectorTest.addResult("parsed attributes modified:"); 63 dumpAttributeAndStyles(); 64 InspectorTest.completeTest(); 65 } 72 ]); 66 73 67 74 function dumpAttributeAndStyles() … … 78 85 function findNodeTreeElement() 79 86 { 87 WebInspector.panels.elements.updateModifiedNodes(); 80 88 var expandedNode = InspectorTest.expandedNodeWithId("container"); 81 89 if (!expandedNode) { -
trunk/LayoutTests/inspector/timeline/timeline-layout.html
r78535 r80416 10 10 element.innerHTML = "Test data"; 11 11 document.body.appendChild(element); 12 // Force layout. 13 var foo = element.offsetHeight; 12 14 } 13 15 -
trunk/LayoutTests/inspector/timeline/timeline-network-resource-expected.txt
r80351 r80416 2 2 Tests the Timeline API instrumentation of a network resource load 3 3 4 Start 5 step0 6 step1 7 step2 8 step3 4 Script resource loaded 9 5 10 6 ResourceSendRequest Properties: … … 50 46 totalHeapSize : <number> 51 47 } 52 Script resource loaded 48 -
trunk/LayoutTests/inspector/timeline/timeline-network-resource.html
r80351 r80416 19 19 var scriptUrl = "timeline-network-resource.js"; 20 20 21 InspectorTest.evaluateInPage("true", step0); 22 InspectorTest.addResult("Start"); 23 24 function step0() 25 { 26 InspectorTest.addResult("step0"); 27 TimelineAgent.start(step1); 28 } 21 InspectorTest.startTimeline(step1); 29 22 30 23 function step1() 31 24 { 32 InspectorTest.addResult("step1");33 25 InspectorTest.evaluateInPage("performActions()"); 34 26 InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2); … … 37 29 function step2() 38 30 { 39 InspectorTest.addResult("step2"); 40 TimelineAgent.stop(step3); 31 InspectorTest.stopTimeline(step3); 41 32 } 42 33 43 34 function step3() 44 35 { 45 InspectorTest.addResult("step3");46 36 function format(record) 47 37 { -
trunk/LayoutTests/inspector/timeline/timeline-script-tag-1.html
r79323 r80416 14 14 function test() 15 15 { 16 TimelineAgent.start(step1);16 InspectorTest.startTimeline(step1); 17 17 function step1() 18 18 { 19 InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2); 19 20 InspectorTest.evaluateInPage("performActions()"); 20 InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", step2);21 21 } 22 22 23 23 function step2() 24 24 { 25 TimelineAgent.stop(step3);25 InspectorTest.stopTimeline(step3); 26 26 } 27 27 -
trunk/LayoutTests/inspector/timeline/timeline-script-tag-2.html
r79323 r80416 14 14 function test() 15 15 { 16 TimelineAgent.start(step1);16 InspectorTest.startTimeline(step1); 17 17 function step1() 18 18 { … … 23 23 function step2() 24 24 { 25 TimelineAgent.stop(step3);25 InspectorTest.stopTimeline(step3); 26 26 } 27 27 -
trunk/LayoutTests/inspector/timeline/timeline-test.js
r79323 r80416 16 16 }; 17 17 18 InspectorTest.startTimeline = function(callback) 19 { 20 InspectorTest._timelineRecords = []; 21 TimelineAgent.start(callback); 22 function addRecord(record) 23 { 24 InspectorTest._timelineRecords.push(record); 25 for (var i = 0; record.children && i < record.children.length; ++i) 26 addRecord(record.children[i]); 27 } 28 InspectorTest.addSniffer(WebInspector.TimelineDispatcher.prototype, "addRecordToTimeline", addRecord, true); 29 }; 30 31 InspectorTest.stopTimeline = function(callback) 32 { 33 TimelineAgent.stop(callback); 34 }; 35 18 36 InspectorTest.performActionsAndPrint = function(actions, typeName) 19 37 { 20 TimelineAgent.start(step1);38 InspectorTest.startTimeline(step1); 21 39 function step1() 22 40 { … … 26 44 function step2() 27 45 { 28 TimelineAgent.stop(step3);46 InspectorTest.stopTimeline(step3); 29 47 } 30 48 … … 34 52 InspectorTest.completeTest(); 35 53 } 36 } 54 }; 37 55 38 56 InspectorTest.printTimelineRecords = function(typeName, formatter) 39 57 { 40 var timelineRecords = InspectorTest._timelineResults(); 41 for (var i = 0; i < timelineRecords.length; ++i) { 42 var record = timelineRecords[i]; 58 for (var i = 0; i < InspectorTest._timelineRecords.length; ++i) { 59 var record = InspectorTest._timelineRecords[i]; 43 60 if (typeName && record.type === WebInspector.TimelineAgent.RecordType[typeName]) 44 61 InspectorTest.printTimelineRecordProperties(record); … … 46 63 formatter(record); 47 64 } 48 };49 50 InspectorTest._timelineResults = function() {51 var result = [];52 function addRecords(records)53 {54 if (!records)55 return;56 for (var i = 0; i < records.length; ++i) {57 result.push(records[i].originalRecordForTests);58 addRecords(records[i].children);59 }60 }61 addRecords(WebInspector.panels.timeline._rootRecord.children);62 return result;63 65 }; 64 66 -
trunk/LayoutTests/inspector/timeline/timeline-trivial.html
r79323 r80416 2 2 <head> 3 3 <script src="../../http/tests/inspector/inspector-test.js"></script> 4 <script src="timeline-test.js"></script> 4 5 <script> 5 6 … … 11 12 InspectorTest.completeTest(); 12 13 } 13 TimelineAgent.start(callback);14 InspectorTest.startTimeline(callback); 14 15 } 15 16 -
trunk/LayoutTests/platform/chromium/inspector/console/console-uncaught-exception-expected.txt
r78535 r80416 1 CONSOLE MESSAGE: line 35: Uncaught Error: Exception in inline script. 2 CONSOLE MESSAGE: line 19: Uncaught Error: Exception in 'load' event listener. 3 CONSOLE MESSAGE: line 27: Uncaught Error: Exception in setTimeout callback. 4 CONSOLE MESSAGE: line 35: Uncaught Error: Exception in inline script. 5 CONSOLE MESSAGE: line 19: Uncaught Error: Exception in 'load' event listener. 6 CONSOLE MESSAGE: line 27: Uncaught Error: Exception in setTimeout callback. 1 CONSOLE MESSAGE: line 18: Uncaught Error: Exception in inline script. 2 CONSOLE MESSAGE: line 11: Uncaught Error: Exception in 'load' event listener. 3 CONSOLE MESSAGE: line 6: Uncaught Error: Exception in setTimeout callback. 7 4 Tests that uncaught exceptions are logged into console.Bug 47250. 8 5 9 Page reloaded. 10 console-uncaught-exception.html:35Uncaught Error: Exception in inline script.aconsole-uncaught-exception.html:35bconsole-uncaught-exception.html:40(anonymous function)console-uncaught-exception.html:43 11 console-uncaught-exception.html:19Uncaught Error: Exception in 'load' event listener.fconsole-uncaught-exception.html:19(anonymous function)console-uncaught-exception.html:21 12 console-uncaught-exception.html:27Uncaught Error: Exception in setTimeout callback.barconsole-uncaught-exception.html:27(anonymous function)console-uncaught-exception.html:29 6 uncaught-iframe.html:18Uncaught Error: Exception in inline script.auncaught-iframe.html:18buncaught-iframe.html:23(anonymous function)uncaught-iframe.html:26 7 uncaught-iframe.html:11Uncaught Error: Exception in 'load' event listener.funcaught-iframe.html:11(anonymous function)uncaught-iframe.html:13 8 uncaught-iframe.html:6Uncaught Error: Exception in setTimeout callback.baruncaught-iframe.html:6(anonymous function)uncaught-iframe.html:8 13 9 -
trunk/LayoutTests/platform/chromium/inspector/debugger/debugger-autocontinue-on-syntax-error-expected.txt
r78535 r80416 1 CONSOLE MESSAGE: line 1: Uncaught SyntaxError: Unexpected token )2 CONSOLE MESSAGE: line 1: Uncaught SyntaxError: Unexpected token )1 CONSOLE MESSAGE: line 4: Uncaught SyntaxError: Unexpected token ) 2 CONSOLE MESSAGE: line 8: Iframe loaded 3 3 Tests that debugger won't stop on syntax errors even if "pause on uncaught exceptions" is on. 4 4 5 5 Debugger was enabled. 6 Page reloaded.7 6 Debugger was disabled. 8 7 -
trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-network-resource-expected.txt
r80364 r80416 2 2 Tests the Timeline API instrumentation of a network resource load 3 3 4 Start 5 step0 6 step1 7 step2 8 step3 4 Script resource loaded 9 5 10 6 ResourceSendRequest Properties: … … 51 47 totalHeapSize : <number> 52 48 } 53 Script resource loaded 49 -
trunk/Source/WebCore/ChangeLog
r80415 r80416 1 2011-03-04 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: fix layout tests flakiness. 6 https://bugs.webkit.org/show_bug.cgi?id=55816 7 8 - Order of issuing of evaluateForTestInFrontend was not guaranteed on the backend side (InspectorAgent side) 9 - Order of dispatching using timeouts was guaranteed via queueing. Source of all kinds of pains on SnowLeopard Release (inspector.js) 10 11 * inspector/CodeGeneratorInspector.pm: 12 * inspector/InspectorAgent.cpp: 13 (WebCore::InspectorAgent::InspectorAgent): 14 (WebCore::InspectorAgent::disconnectFrontend): 15 (WebCore::InspectorAgent::populateScriptObjects): 16 (WebCore::InspectorAgent::evaluateForTestInFrontend): 17 (WebCore::InspectorAgent::issueEvaluateForTestCommands): 18 * inspector/InspectorAgent.h: 19 * inspector/front-end/TimelinePanel.js: 20 (WebInspector.TimelinePanel.FormattedRecord): 21 * inspector/front-end/inspector.js: 22 (WebInspector.dispatch): 23 1 24 2011-03-05 Adam Barth <abarth@webkit.org> 2 25 -
trunk/Source/WebCore/inspector/CodeGeneratorInspector.pm
r80349 r80416 779 779 { 780 780 var callbackId = this._lastCallbackId++; 781 ++this._pendingResponsesCount;782 781 this._callbacks[callbackId] = callback || function() {}; 783 782 return callbackId; … … 825 824 826 825 var message = JSON.stringify(request); 826 827 ++this._pendingResponsesCount; 827 828 InspectorFrontendHost.sendMessageToBackend(message); 828 829 }, -
trunk/Source/WebCore/inspector/InspectorAgent.cpp
r80350 r80416 159 159 , m_profilerAgent(InspectorProfilerAgent::create(m_instrumentingAgents.get(), m_consoleAgent.get(), page)) 160 160 #endif 161 , m_canIssueEvaluateForTestInFrontend(false) 161 162 { 162 163 ASSERT_ARG(page, page); … … 395 396 return; 396 397 398 m_canIssueEvaluateForTestInFrontend = false; 399 m_pendingEvaluateTestCommands.clear(); 400 397 401 // Destroying agents would change the state, but we don't want that. 398 402 // Pre-disconnect state will be used to restore inspector agents. … … 470 474 471 475 // Dispatch pending frontend commands 472 for (Vector<pair<long, String> >::iterator it = m_pendingEvaluateTestCommands.begin(); it != m_pendingEvaluateTestCommands.end(); ++it) 473 m_frontend->inspector()->evaluateForTestInFrontend((*it).first, (*it).second); 474 m_pendingEvaluateTestCommands.clear(); 476 issueEvaluateForTestCommands(); 475 477 } 476 478 … … 763 765 void InspectorAgent::evaluateForTestInFrontend(long callId, const String& script) 764 766 { 765 if (m_frontend) 766 m_frontend->inspector()->evaluateForTestInFrontend(callId, script); 767 else 768 m_pendingEvaluateTestCommands.append(pair<long, String>(callId, script)); 767 m_pendingEvaluateTestCommands.append(pair<long, String>(callId, script)); 768 if (m_canIssueEvaluateForTestInFrontend) 769 issueEvaluateForTestCommands(); 769 770 } 770 771 … … 1094 1095 } 1095 1096 1097 void InspectorAgent::issueEvaluateForTestCommands() 1098 { 1099 if (m_frontend) { 1100 Vector<pair<long, String> > copy = m_pendingEvaluateTestCommands; 1101 m_pendingEvaluateTestCommands.clear(); 1102 for (Vector<pair<long, String> >::iterator it = copy.begin(); m_frontend && it != copy.end(); ++it) 1103 m_frontend->inspector()->evaluateForTestInFrontend((*it).first, (*it).second); 1104 m_canIssueEvaluateForTestInFrontend = true; 1105 } 1106 } 1107 1096 1108 } // namespace WebCore 1097 1109 -
trunk/Source/WebCore/inspector/InspectorAgent.h
r80338 r80416 240 240 void focusNode(); 241 241 bool isMainResourceLoader(DocumentLoader*, const KURL& requestUrl); 242 void issueEvaluateForTestCommands(); 242 243 243 244 Page* m_inspectedPage; … … 283 284 #if ENABLE(WORKERS) 284 285 typedef HashMap<intptr_t, RefPtr<InspectorWorkerResource> > WorkersMap; 285 286 286 WorkersMap m_workers; 287 287 #endif 288 bool m_canIssueEvaluateForTestInFrontend; 288 289 }; 289 290 -
trunk/Source/WebCore/inspector/front-end/TimelinePanel.js
r79323 r80416 866 866 this._selfTime = this.endTime - this.startTime; 867 867 this._lastChildEndTime = this.endTime; 868 this.originalRecordForTests = record;869 868 if (record.stackTrace && record.stackTrace.length) 870 869 this.stackTrace = record.stackTrace; -
trunk/Source/WebCore/inspector/front-end/inspector.js
r80239 r80416 571 571 window.addEventListener("DOMContentLoaded", windowLoaded, false); 572 572 573 // We'd like to enforce asynchronous interaction between the inspector controller and the frontend. 574 // It is needed to prevent re-entering the backend code. 575 // Also, native dispatches do not guarantee setTimeouts to be serialized, so we 576 // enforce serialization using 'messagesToDispatch' queue. It is also important that JSC debugger 577 // tests require that each command was dispatch within individual timeout callback, so we don't batch them. 578 579 var messagesToDispatch = []; 580 573 581 WebInspector.dispatch = function(message) { 574 // We'd like to enforce asynchronous interaction between the inspector controller and the frontend. 575 // This is important to LayoutTests. 576 setTimeout(InspectorBackend.dispatch.bind(InspectorBackend), 0, message); 582 messagesToDispatch.push(message); 583 setTimeout(function() { 584 InspectorBackend.dispatch(messagesToDispatch.shift()); 585 }, 0); 577 586 } 578 587
Note: See TracChangeset
for help on using the changeset viewer.