Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.html

Issue 2882193002: [devtools] Add DOMSnapshot domain for dom+layout+style snapshots. (Closed)
Patch Set: back to DOMSnapshot domain, with custom node types + traversal. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/css/css-getLayoutTreeNodes.html b/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.html
similarity index 58%
rename from third_party/WebKit/LayoutTests/inspector-protocol/css/css-getLayoutTreeNodes.html
rename to third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.html
index 43ea5445abe3b8cf023e430d89d0c2fe6b3333ab..b461ad08fb8ee7a5df375b827b8678709f6f5295 100644
--- a/third_party/WebKit/LayoutTests/inspector-protocol/css/css-getLayoutTreeNodes.html
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.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("DOMSnapshot.getSnapshot", {"computedStyleWhitelist": whitelist, "depth": -1, "pierce": true}, onSnapshot);
pfeldman 2017/06/06 22:54:29 It's a new world! async function test() { await
Eric Seckler 2017/06/07 10:23:37 Done.
Eric Seckler 2017/06/07 10:23:37 Done, also removed unnecessary DOM.enable :)
- // 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 onSnapshot(response) {
+ function stabilize(key, value) {
+ var unstableKeys = ["documentURL", "baseURL", "frameId"];
+ if (unstableKeys.indexOf(key) !== -1)
+ return "<" + typeof(value) + ">";
+ return value;
}
+ InspectorTest.log(JSON.stringify(response, stabilize, 2));
+ InspectorTest.completeTest();
}
}

Powered by Google App Engine
This is Rietveld 408576698