Changeset 116739 in webkit
- Timestamp:
- May 11, 2012 1:29:08 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r116737 r116739 1 2012-05-10 Andrey Kosyakov <caseq@chromium.org> 2 3 Web Inspector: [Extensions API] add audit formatters for remote objects and DOM elements 4 https://bugs.webkit.org/show_bug.cgi?id=86108 5 6 Reviewed by Pavel Feldman. 7 8 - rebaselined tests to account for two new AuditResults method and their results; 9 10 * inspector/extensions/extensions-audits-api-expected.txt: 11 * inspector/extensions/extensions-audits-expected.txt: 12 * inspector/extensions/extensions-audits-tests.js: 13 (initialize_ExtensionsAuditsTest.InspectorTest.startExtensionAudits.onAuditsDone): 14 * inspector/extensions/extensions-audits.html: 15 1 16 2012-05-11 Csaba Osztrogonác <ossy@webkit.org> 2 17 -
trunk/LayoutTests/inspector/audits/audits-test.js
r82713 r116739 22 22 for (var i = 0; i < level; ++i) 23 23 nodeOutput += " "; 24 nodeOutput += child.nodeValue ;24 nodeOutput += child.nodeValue.replace("\u200B", ""); 25 25 } else if (child.nodeType === Node.ELEMENT_NODE) { 26 26 if (nodeOutput !== "") { -
trunk/LayoutTests/inspector/extensions/extensions-audits-api-expected.txt
r101760 r116739 11 11 } 12 12 } 13 Extension audits14 13 category.onAuditStarted fired, results dump follows: 15 14 { … … 17 16 createSnippet : <function> 18 17 createText : <function> 18 createObject : <function> 19 createNode : <function> 19 20 addResult : <function> 20 21 createResult : <function> … … 36 37 addChild : <function> 37 38 } 39 Extension audits 38 40 All tests done. 39 41 -
trunk/LayoutTests/inspector/extensions/extensions-audits-api.html
r82713 r116739 16 16 var node = results.createResult("Subtree"); 17 17 dumpObject(node); 18 results.done(); 18 // Make sure dumpObject() pushes stuff through before we continue. 19 evaluateOnFrontend("InspectorTest.runAfterPendingDispatches(reply)", function() { 20 results.done(); 21 }); 19 22 } 20 23 var category = webInspector.audits.addCategory("Extension audits", 20); -
trunk/LayoutTests/inspector/extensions/extensions-audits-expected.txt
r101760 r116739 1 1 Tests audits support in WebInspector Extensions API 2 2 3 Started extension.3 Started extension. 4 4 Running tests... 5 5 RUNNING TEST: extension_testAudits … … 20 20 } 21 21 /path/to/error.html:10 22 object details 23 a 24 : 25 42 26 b 27 : 28 "foo" 29 __proto__ 30 : 31 Object 32 < 33 span 34 35 id 36 =" 37 test-element 38 " 39 > 40 22 41 extensions-audits.html:20 23 42 Passed rule -
trunk/LayoutTests/inspector/extensions/extensions-audits-tests.js
r89656 r116739 21 21 function onAuditsDone() 22 22 { 23 InspectorTest.collectAuditResults(); 24 callback(); 23 InspectorTest.runAfterPendingDispatches(function() { 24 InspectorTest.collectAuditResults(); 25 callback(); 26 }); 25 27 } 26 28 InspectorTest.addSniffer(WebInspector.panels.audits, "_auditFinishedCallback", onAuditsDone, true); -
trunk/LayoutTests/inspector/extensions/extensions-audits.html
r101760 r116739 24 24 nestedNode.addChild(results.createSnippet("function rand()\n{\n return 4;\n}")); 25 25 nestedNode.addChild(results.createResourceLink("file:///path/to/error.html", 10)); 26 nestedNode.addChild(results.createObject("({a: 42, b: 'foo'})", "object details")); 27 nestedNode.addChild(results.createNode("document.getElementById('test-element')")); 28 26 29 webInspector.inspectedWindow.eval("location.href", function(inspectedPageURL) { 27 30 nestedNode.addChild(results.createResourceLink(inspectedPageURL, 20)); … … 69 72 <body onload="runTest()"> 70 73 <p>Tests audits support in WebInspector Extensions API</p> 74 <span id="test-element"><b></b></span> 71 75 </body> 72 76 </html> -
trunk/Source/WebCore/ChangeLog
r116736 r116739 1 2012-05-10 Andrey Kosyakov <caseq@chromium.org> 2 3 Web Inspector: [Extensions API] add audit formatters for remote objects and DOM elements 4 https://bugs.webkit.org/show_bug.cgi?id=86108 5 6 Reviewed by Pavel Feldman. 7 8 - added two new formatters to AuditResults object of webInspector.audits API; 9 10 * inspector/front-end/AuditFormatters.js: 11 (WebInspector.AuditFormatters.resourceLink): 12 (WebInspector.AuditFormatters.object.onEvaluate): 13 (WebInspector.AuditFormatters.object): format as a remote object property list; 14 (WebInspector.AuditFormatters.node.onNodeAvailable): 15 (WebInspector.AuditFormatters.node.onEvaluate): 16 (WebInspector.AuditFormatters.node): format as a DOM elements sub-tree; 17 (WebInspector.AuditFormatters.Utilities.evaluate): common expression evaluation logic for both new formatters; 18 * inspector/front-end/ExtensionAPI.js: 19 (injectedExtensionAPI.AuditResultImpl): 20 * inspector/front-end/auditsPanel.css: 21 (.audit-result-tree ol.outline-disclosure): 22 (.audit-result-tree .section .header): 23 (.audit-result-tree .section .header::before): 24 1 25 2012-05-11 Sheriff Bot <webkit.review.bot@gmail.com> 2 26 -
trunk/Source/WebCore/inspector/front-end/AuditFormatters.js
r101760 r116739 1 1 /* 2 * Copyright (C) 201 0Google Inc. All rights reserved.2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 97 97 // FIXME: use WebInspector.DebuggerPresentationModel.Linkifier 98 98 return WebInspector.linkifyResourceAsNode(url, line, "console-message-url webkit-html-resource-link"); 99 }, 100 101 /** 102 * @param {string} expression 103 * @param {string} title 104 */ 105 object: function(expression, title) 106 { 107 var parentElement = document.createElement("div"); 108 function onEvaluate(remoteObject) 109 { 110 var section = new WebInspector.ObjectPropertiesSection(remoteObject, title); 111 section.expanded = true; 112 section.editable = false; 113 parentElement.appendChild(section.element); 114 } 115 WebInspector.AuditFormatters.Utilities.evaluate(expression, onEvaluate); 116 return parentElement; 117 }, 118 119 /** 120 * @param {string} expression 121 */ 122 node: function(expression) 123 { 124 var treeOutline = new WebInspector.ElementsTreeOutline(false, false, true); 125 /** 126 * @param {?number} nodeId 127 */ 128 function onNodeAvailable(nodeId) 129 { 130 if (!nodeId) 131 return; 132 treeOutline.rootDOMNode = WebInspector.domAgent.nodeForId(nodeId); 133 treeOutline.element.addStyleClass("outline-disclosure"); 134 treeOutline.setVisible(true); 135 } 136 /** 137 * @param {WebInspector.RemoteObject} remoteObject 138 */ 139 function onEvaluate(remoteObject) 140 { 141 remoteObject.pushNodeToFrontend(onNodeAvailable); 142 } 143 WebInspector.AuditFormatters.Utilities.evaluate(expression, onEvaluate); 144 return treeOutline.element; 99 145 } 100 146 }; 147 148 WebInspector.AuditFormatters.Utilities = { 149 /** 150 * @param {string} expression 151 * @param {function(WebInspector.RemoteObject)} callback 152 */ 153 evaluate: function(expression, callback) 154 { 155 /** 156 * @param {?string} error 157 * @param {?RuntimeAgent.RemoteObject} result 158 * @param {boolean=} wasThrown 159 */ 160 function onEvaluate(error, result, wasThrown) 161 { 162 if (wasThrown) 163 return; 164 var object = WebInspector.RemoteObject.fromPayload(result); 165 callback(object); 166 } 167 RuntimeAgent.evaluate(expression, "extension-watch", true, undefined, undefined, undefined, onEvaluate); 168 } 169 }; 170 -
trunk/Source/WebCore/inspector/front-end/ExtensionAPI.js
r108972 r116739 1 1 /* 2 * Copyright (C) 201 1Google Inc. All rights reserved.2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 499 499 this.createSnippet = this._nodeFactory.bind(null, "snippet"); 500 500 this.createText = this._nodeFactory.bind(null, "text"); 501 this.createObject = this._nodeFactory.bind(null, "object"); 502 this.createNode = this._nodeFactory.bind(null, "node"); 501 503 } 502 504 -
trunk/Source/WebCore/inspector/front-end/auditsPanel.css
r103765 r116739 179 179 } 180 180 181 .audit-result-tree ol.outline-disclosure { 182 -webkit-padding-start: 0; 183 } 184 185 .audit-result-tree .section .header { 186 padding-left: 13px; 187 } 188 189 .audit-result-tree .section .header::before { 190 left: 2px; 191 } 192 181 193 .audit-result-tree li { 182 194 padding: 0 0 0 14px;
Note: See TracChangeset
for help on using the changeset viewer.