Index: third_party/WebKit/LayoutTests/inspector-protocol/css/css-getDocumentSnapshot.html |
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/css/css-getLayoutTreeNodes.html b/third_party/WebKit/LayoutTests/inspector-protocol/css/css-getDocumentSnapshot.html |
similarity index 58% |
rename from third_party/WebKit/LayoutTests/inspector-protocol/css/css-getLayoutTreeNodes.html |
rename to third_party/WebKit/LayoutTests/inspector-protocol/css/css-getDocumentSnapshot.html |
index 43ea5445abe3b8cf023e430d89d0c2fe6b3333ab..565fa48224baa5ee9821066a719a402417b5e5a4 100644 |
--- a/third_party/WebKit/LayoutTests/inspector-protocol/css/css-getLayoutTreeNodes.html |
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/css/css-getDocumentSnapshot.html |
@@ -12,35 +12,19 @@ |
function test() |
{ |
InspectorTest.sendCommand("DOM.enable", {}); |
- InspectorTest.sendCommandOrDie("DOM.getDocument", {"depth": -1}, onDocument); |
- function onDocument(response) { |
- var whitelist = ["transform", "transform-origin", "height", "width", "display", "outline-color"]; |
- InspectorTest.sendCommandOrDie("CSS.getLayoutTreeAndStyles", {"computedStyleWhitelist": whitelist}, onLayoutTreeNodes); |
- } |
- |
- function onLayoutTreeNodes(response) |
- { |
- InspectorTest.log("\nLayoutTreeNodes result:"); |
- canonicalizeBackendNodeIds(response); |
- InspectorTest.log(JSON.stringify(response, null, 2)); |
- InspectorTest.completeTest(); |
- } |
+ var whitelist = ["transform", "transform-origin", "height", "width", "display", "outline-color"]; |
+ InspectorTest.sendCommandOrDie("CSS.getDocumentSnapshot", {"computedStyleWhitelist": whitelist, "depth": -1, "pierce": true}, onDocumentSnapshot); |
- // While unique the backendNodeId IDs are not stable cross platform, so we canonicalize them. |
- var nextId = 1; |
- var nodeMap = {}; |
- function canonicalizeBackendNodeIds(node) { |
- if (node.hasOwnProperty('backendNodeId')) { |
- if (!nodeMap.hasOwnProperty(node.backendNodeId)) { |
- nodeMap[node.backendNodeId] = nextId++; |
- } |
- node.backendNodeId = nodeMap[node.backendNodeId]; |
- } |
- for (var property in node) { |
- if (!node.hasOwnProperty(property) || typeof node[property] === 'object') |
- canonicalizeBackendNodeIds(node[property]); |
+ function onDocumentSnapshot(response) { |
+ function stabilize(key, value) { |
+ var unstableKeys = ["backendNodeId", "documentURL", "baseURL", "frameId"]; |
+ if (unstableKeys.indexOf(key) !== -1) |
+ return "<" + typeof(value) + ">"; |
+ return value; |
} |
+ InspectorTest.log(JSON.stringify(response, stabilize, 2)); |
+ InspectorTest.completeTest(); |
} |
} |