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

Side by Side 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, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 (async function(testRunner) {
2 let {page, session, dp} = await testRunner.startURL('../resources/dom-snapshot .html', 'Tests DOMSnapshot.getSnapshot method.');
3
4 await session.evaluate(`
5 var host = document.querySelector('#shadow-host').createShadowRoot();
6 var template = document.querySelector('#shadow-template');
7 host.appendChild(template.content);
8 template.remove();
9 document.body.offsetWidth;
10 `);
11
12 function stabilize(key, value) {
13 var unstableKeys = ['documentURL', 'baseURL', 'frameId', 'backendNodeId'];
14 if (unstableKeys.indexOf(key) !== -1)
15 return '<' + typeof(value) + '>';
16 if (typeof value === 'string' && value.indexOf('/dom-snapshot/') !== -1)
17 value = '<value>';
18 return value;
19 }
20
21 var whitelist = ['transform', 'transform-origin', 'height', 'width', 'display' , 'outline-color', 'color'];
22 var response = await dp.DOMSnapshot.getSnapshot({'computedStyleWhitelist': whi telist});
23 if (response.error)
24 testRunner.log(response);
25 else
26 testRunner.log(JSON.stringify(response.result, stabilize, 2));
27 testRunner.completeTest();
28 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698