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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/layers/paint-profiler.js

Issue 2954343004: [DevTools] Migrate inspector-protocol/layers tests to new harness (Closed)
Patch Set: fix test 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.startHTML(`
3 <head>
4 <style type='text/css'>
5 .composited {
6 position: absolute;
7 top: 25px;
8 left: 25px;
9 width: 50px;
10 height: 50px;
11 background-color: blue;
12 transform: translateZ(10px);
13 }
14 </style>
15 </head>
16 <body>
17 <div class='composited'>
18 Sanity test for DevTools Paint Profiler.
19 </div>
20 </body>
21 `, 'Sanity test for DevTools Paint Profiler.');
22
23 await dp.DOM.getDocument();
24 dp.LayerTree.enable();
25 var layers = (await dp.LayerTree.onceLayerTreeDidChange()).params.layers;
26 var matchingLayers = layers.filter(layer => !!(layer.backendNodeId && layer.tr ansform));
27 testRunner.log('matchingLayers.length: ' + matchingLayers.length);
28
29 var layerId = matchingLayers[0].layerId;
30 var snapshotId = (await dp.LayerTree.makeSnapshot({layerId})).result.snapshotI d;
31 var timings = (await dp.LayerTree.profileSnapshot({snapshotId, minRepeatCount: 4, minDuration: 0})).result.timings;
32 testRunner.log('Profile array length: ' + timings.length);
33 for (var i = 0; i < timings.length; ++i) {
34 testRunner.log('Profile subarray ' + i + ' length: ' + timings[i].length);
35 for (var j = 0; j < timings[i].length; ++j)
36 testRunner.log('Profile timing [' + i + '][' + j + '] is a number: ' + (ti mings[i][j] >= 0));
37 }
38
39 var image = (await dp.LayerTree.replaySnapshot({snapshotId, fromStep: 2, toSte p: timings[0].length - 2})).result.dataURL;
40 testRunner.log('LayerTree.replaySnapshot returned valid image: ' + /^data:imag e\/png;base64,/.test(image));
41 testRunner.log('DONE!');
42 testRunner.completeTest();
43 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698