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

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

Issue 2947303002: [DevTools] Migrate inspector-protocol/{page,dom-snapshot} tests to new harness (Closed)
Patch Set: rebased 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.js
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.js b/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.js
new file mode 100644
index 0000000000000000000000000000000000000000..5983612fa5ba646364b44156d6da2a5756714fde
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.js
@@ -0,0 +1,28 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startURL('../resources/dom-snapshot.html', 'Tests DOMSnapshot.getSnapshot method.');
+
+ await session.evaluate(`
+ var host = document.querySelector('#shadow-host').createShadowRoot();
+ var template = document.querySelector('#shadow-template');
+ host.appendChild(template.content);
+ template.remove();
+ document.body.offsetWidth;
+ `);
+
+ function stabilize(key, value) {
+ var unstableKeys = ['documentURL', 'baseURL', 'frameId', 'backendNodeId'];
+ if (unstableKeys.indexOf(key) !== -1)
+ return '<' + typeof(value) + '>';
+ if (typeof value === 'string' && value.indexOf('/dom-snapshot/') !== -1)
+ value = '<value>';
+ return value;
+ }
+
+ var whitelist = ['transform', 'transform-origin', 'height', 'width', 'display', 'outline-color', 'color'];
+ var response = await dp.DOMSnapshot.getSnapshot({'computedStyleWhitelist': whitelist});
+ if (response.error)
+ testRunner.log(response);
+ else
+ testRunner.log(JSON.stringify(response.result, stabilize, 2));
+ testRunner.completeTest();
+})

Powered by Google App Engine
This is Rietveld 408576698