Changeset 85849 in webkit
- Timestamp:
- May 5, 2011 5:14:17 AM (13 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r85848 r85849 1 2011-05-04 Andrey Kosyakov <caseq@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: add test for shadow DOM access in the console API 6 https://bugs.webkit.org/show_bug.cgi?id=60192 7 8 * http/tests/inspector/elements-test.js: 9 (initialize_ElementTest.InspectorTest.findNode.processChildren): 10 (initialize_ElementTest.InspectorTest.nodeWithId): 11 (initialize_ElementTest.InspectorTest.selectNode): 12 * inspector/console/console-shadow-dom-access-expected.txt: Added. 13 * inspector/console/console-shadow-dom-access.html: Added. 14 1 15 2011-05-05 Philippe Normand <pnormand@igalia.com> 2 16 -
trunk/LayoutTests/http/tests/inspector/elements-test.js
r85751 r85849 1 1 var initialize_ElementTest = function() { 2 2 3 4 InspectorTest.nodeWithId = function(idValue, callback) 3 InspectorTest.findNode = function(matchFunction, callback) 5 4 { 6 5 callback = InspectorTest.safeWrap(callback); … … 16 15 for (var i = 0; children && i < children.length; ++i) { 17 16 var childNode = children[i]; 18 if ( childNode.getAttribute("id") === idValue) {17 if (matchFunction(childNode)) { 19 18 result = childNode; 19 callback(result); 20 return; 21 } 22 if (childNode.shadowRoot && matchFunction(childNode.shadowRoot)) { 23 result = childNode.shadowRoot; 20 24 callback(result); 21 25 return; … … 43 47 }; 44 48 49 InspectorTest.nodeWithId = function(idValue, callback) 50 { 51 function nodeIdMatches(node) 52 { 53 return node.getAttribute("id") === idValue; 54 } 55 InspectorTest.findNode(nodeIdMatches, callback); 56 } 57 45 58 InspectorTest.expandedNodeWithId = function(idValue) 46 59 { … … 56 69 InspectorTest.selectNodeWithId = function(idValue, callback) 57 70 { 71 function onNodeFound(node) 72 { 73 InspectorTest.selectNode(node, callback); 74 } 75 InspectorTest.nodeWithId(idValue, onNodeFound); 76 }; 77 78 InspectorTest.selectNode = function(node, callback) 79 { 58 80 callback = InspectorTest.safeWrap(callback); 59 function mycallback(node) 60 { 61 if (node) 62 WebInspector.updateFocusedNode(node.id); 63 InspectorTest.runAfterPendingDispatches(callback.bind(null, node)); 64 } 65 InspectorTest.nodeWithId(idValue, mycallback); 66 }; 81 if (node) 82 WebInspector.updateFocusedNode(node.id); 83 InspectorTest.runAfterPendingDispatches(callback.bind(null, node)); 84 } 67 85 68 86 InspectorTest.dumpSelectedElementStyles = function(excludeComputed, excludeMatched, omitLonghands) … … 193 211 } 194 212 195 function mycallback()213 function onAllNodesAvailable() 196 214 { 197 215 WebInspector.panels.elements.updateModifiedNodes(); … … 199 217 callback(); 200 218 } 201 InspectorTest. nodeWithId(/nonstring/, mycallback);219 InspectorTest.findNode(function() { return false; }, onAllNodesAvailable); 202 220 }; 203 221
Note: See TracChangeset
for help on using the changeset viewer.