| OLD | NEW |
| 1 function getInspectorHighlightJSON(nodeId, opt_frameId) | 1 function getInspectorHighlightJSON(nodeId, opt_frameId) |
| 2 { | 2 { |
| 3 var doc = document; | 3 var doc = document; |
| 4 if (opt_frameId) | 4 if (opt_frameId) |
| 5 doc = document.getElementById(opt_frameId).contentDocument; | 5 doc = document.getElementById(opt_frameId).contentDocument; |
| 6 return window.internals.inspectorHighlightJSON(doc.getElementById(nodeId)); | 6 return window.internals.inspectorHighlightJSON(doc.getElementById(nodeId)); |
| 7 } | 7 } |
| 8 | 8 |
| 9 var initialize_ElementTest = function() { | 9 var initialize_ElementTest = function() { |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 childNode.getChildNodes(processChildren.bind(null, childNode)); | 60 childNode.getChildNodes(processChildren.bind(null, childNode)); |
| 61 } | 61 } |
| 62 } finally { | 62 } finally { |
| 63 pendingRequests--; | 63 pendingRequests--; |
| 64 } | 64 } |
| 65 | 65 |
| 66 if (!result && !pendingRequests) | 66 if (!result && !pendingRequests) |
| 67 callback(null); | 67 callback(null); |
| 68 } | 68 } |
| 69 | 69 |
| 70 WebInspector.domModel.requestDocument(documentRequested.bind(this)); | 70 InspectorTest.domModel.requestDocument(documentRequested.bind(this)); |
| 71 function documentRequested(doc) | 71 function documentRequested(doc) |
| 72 { | 72 { |
| 73 pendingRequests++; | 73 pendingRequests++; |
| 74 doc.getChildNodes(processChildren.bind(null, doc)); | 74 doc.getChildNodes(processChildren.bind(null, doc)); |
| 75 } | 75 } |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 InspectorTest.nodeWithId = function(idValue, callback) | 78 InspectorTest.nodeWithId = function(idValue, callback) |
| 79 { | 79 { |
| 80 function nodeIdMatches(node) | 80 function nodeIdMatches(node) |
| 81 { | 81 { |
| 82 return node.getAttribute("id") === idValue; | 82 return node.getAttribute("id") === idValue; |
| 83 } | 83 } |
| 84 InspectorTest.findNode(nodeIdMatches, callback); | 84 InspectorTest.findNode(nodeIdMatches, callback); |
| 85 } | 85 } |
| 86 | 86 |
| 87 InspectorTest.querySelector = function(selector, callback) | 87 InspectorTest.querySelector = function(selector, callback) |
| 88 { | 88 { |
| 89 WebInspector.domModel.requestDocument(documentRequested.bind(this)); | 89 InspectorTest.domModel.requestDocument(documentRequested.bind(this)); |
| 90 | 90 |
| 91 function documentRequested(doc) | 91 function documentRequested(doc) |
| 92 { | 92 { |
| 93 WebInspector.domModel.querySelector(doc.id, selector, nodeSelected); | 93 InspectorTest.domModel.querySelector(doc.id, selector, nodeSelected); |
| 94 } | 94 } |
| 95 | 95 |
| 96 function nodeSelected(nodeId) | 96 function nodeSelected(nodeId) |
| 97 { | 97 { |
| 98 callback(WebInspector.domModel.nodeForId(nodeId)); | 98 callback(InspectorTest.domModel.nodeForId(nodeId)); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 InspectorTest.shadowRootByHostId = function(idValue, callback) | 102 InspectorTest.shadowRootByHostId = function(idValue, callback) |
| 103 { | 103 { |
| 104 function shadowRootMatches(node) | 104 function shadowRootMatches(node) |
| 105 { | 105 { |
| 106 return node.isShadowRoot() && node.parentNode.getAttribute("id") === idV
alue; | 106 return node.isShadowRoot() && node.parentNode.getAttribute("id") === idV
alue; |
| 107 } | 107 } |
| 108 InspectorTest.findNode(shadowRootMatches, callback); | 108 InspectorTest.findNode(shadowRootMatches, callback); |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 InspectorTest.firstElementsTreeOutline().runPendingUpdates(); | 632 InspectorTest.firstElementsTreeOutline().runPendingUpdates(); |
| 633 expand(InspectorTest.firstElementsTreeOutline()); | 633 expand(InspectorTest.firstElementsTreeOutline()); |
| 634 // Make all promises succeed. | 634 // Make all promises succeed. |
| 635 setTimeout(callback.bind(null, expandedSomething)); | 635 setTimeout(callback.bind(null, expandedSomething)); |
| 636 } | 636 } |
| 637 InspectorTest.findNode(function() { return false; }, onAllNodesAvailable); | 637 InspectorTest.findNode(function() { return false; }, onAllNodesAvailable); |
| 638 }; | 638 }; |
| 639 | 639 |
| 640 InspectorTest.dumpDOMAgentTree = function(node) | 640 InspectorTest.dumpDOMAgentTree = function(node) |
| 641 { | 641 { |
| 642 if (!WebInspector.domModel._document) | 642 if (!InspectorTest.domModel._document) |
| 643 return; | 643 return; |
| 644 | 644 |
| 645 function dump(node, prefix) | 645 function dump(node, prefix) |
| 646 { | 646 { |
| 647 InspectorTest.addResult(prefix + node.nodeName()); | 647 InspectorTest.addResult(prefix + node.nodeName()); |
| 648 prefix = prefix + " "; | 648 prefix = prefix + " "; |
| 649 | 649 |
| 650 if (node.templateContent()) | 650 if (node.templateContent()) |
| 651 dump(node.templateContent(), prefix); | 651 dump(node.templateContent(), prefix); |
| 652 if (node.importedDocument()) | 652 if (node.importedDocument()) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 InspectorTest.addResult("Post-action:"); | 684 InspectorTest.addResult("Post-action:"); |
| 685 InspectorTest.dumpElementsTree(testNode); | 685 InspectorTest.dumpElementsTree(testNode); |
| 686 InspectorTest.expandElementsTree(expandedCallback); | 686 InspectorTest.expandElementsTree(expandedCallback); |
| 687 | 687 |
| 688 function expandedCallback(expandedSomething) | 688 function expandedCallback(expandedSomething) |
| 689 { | 689 { |
| 690 if (expandedSomething) { | 690 if (expandedSomething) { |
| 691 InspectorTest.addResult("== Expanded: =="); | 691 InspectorTest.addResult("== Expanded: =="); |
| 692 InspectorTest.dumpElementsTree(testNode); | 692 InspectorTest.dumpElementsTree(testNode); |
| 693 } | 693 } |
| 694 WebInspector.domModel.undo(redo); | 694 InspectorTest.domModel.undo(redo); |
| 695 } | 695 } |
| 696 } | 696 } |
| 697 | 697 |
| 698 function redo() | 698 function redo() |
| 699 { | 699 { |
| 700 InspectorTest.addResult("Post-undo (initial):"); | 700 InspectorTest.addResult("Post-undo (initial):"); |
| 701 InspectorTest.dumpElementsTree(testNode); | 701 InspectorTest.dumpElementsTree(testNode); |
| 702 InspectorTest.expandElementsTree(expandedCallback); | 702 InspectorTest.expandElementsTree(expandedCallback); |
| 703 | 703 |
| 704 function expandedCallback(expandedSomething) | 704 function expandedCallback(expandedSomething) |
| 705 { | 705 { |
| 706 if (expandedSomething) { | 706 if (expandedSomething) { |
| 707 InspectorTest.addResult("== Expanded: =="); | 707 InspectorTest.addResult("== Expanded: =="); |
| 708 InspectorTest.dumpElementsTree(testNode); | 708 InspectorTest.dumpElementsTree(testNode); |
| 709 } | 709 } |
| 710 WebInspector.domModel.redo(done); | 710 InspectorTest.domModel.redo(done); |
| 711 } | 711 } |
| 712 } | 712 } |
| 713 | 713 |
| 714 function done() | 714 function done() |
| 715 { | 715 { |
| 716 InspectorTest.addResult("Post-redo (action):"); | 716 InspectorTest.addResult("Post-redo (action):"); |
| 717 InspectorTest.dumpElementsTree(testNode); | 717 InspectorTest.dumpElementsTree(testNode); |
| 718 InspectorTest.expandElementsTree(expandedCallback); | 718 InspectorTest.expandElementsTree(expandedCallback); |
| 719 | 719 |
| 720 function expandedCallback(expandedSomething) | 720 function expandedCallback(expandedSomething) |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 function innerCallback(result) | 890 function innerCallback(result) |
| 891 { | 891 { |
| 892 InspectorTest.addResult(nodeId + ": " + result.description); | 892 InspectorTest.addResult(nodeId + ": " + result.description); |
| 893 callback(); | 893 callback(); |
| 894 } | 894 } |
| 895 opt_frameId = opt_frameId || ""; | 895 opt_frameId = opt_frameId || ""; |
| 896 InspectorTest.evaluateInPage("getInspectorHighlightJSON(\"" + nodeId + "\",
\"" + opt_frameId + "\")", innerCallback); | 896 InspectorTest.evaluateInPage("getInspectorHighlightJSON(\"" + nodeId + "\",
\"" + opt_frameId + "\")", innerCallback); |
| 897 } | 897 } |
| 898 | 898 |
| 899 }; | 899 }; |
| OLD | NEW |