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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/timeline/timeline-layout.js

Issue 2942573003: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: unified 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 unified diff | Download patch
OLDNEW
(Empty)
1 (async function() {
2 let {page, session, Protocol} = await InspectorTest.startHTML(`
3 <style>
4 .my-class {
5 min-width: 100px;
6 background-color: red;
7 }
8 </style>
9 <div id='myDiv'>DIV</div>
10 `, '');
11
12 function performActions() {
13 var div = document.querySelector('#myDiv');
14 div.classList.add('my-class');
15 div.offsetWidth;
16 return Promise.resolve();
17 }
18
19 (await InspectorTest.loadScript('../resources/tracing-test.js'))(session);
20 await session.evaluate(performActions.toString());
21 InspectorTest.invokeAsyncWithTracing('performActions', finish);
22
23 function finish(devtoolsEvents) {
24 var schedRecalc = InspectorTest.findEvent('ScheduleStyleRecalculation', 'I') ;
25 var recalcBegin = InspectorTest.findEvent('UpdateLayoutTree', 'B');
26 var recalcEnd = InspectorTest.findEvent('UpdateLayoutTree', 'E');
27 InspectorTest.log('UpdateLayoutTree frames match: ' + (schedRecalc.args.data .frame === recalcBegin.args.beginData.frame));
28 InspectorTest.log('UpdateLayoutTree elementCount > 0: ' + (recalcEnd.args.el ementCount > 0));
29
30 var invalidate = InspectorTest.findEvent('InvalidateLayout', 'I');
31 var layoutBegin = InspectorTest.findEvent('Layout', 'B');
32 var layoutEnd = InspectorTest.findEvent('Layout', 'E');
33
34 InspectorTest.log('InvalidateLayout frames match: ' + (recalcBegin.args.begi nData.frame === invalidate.args.data.frame));
35
36 var beginData = layoutBegin.args.beginData;
37 InspectorTest.log('Layout frames match: ' + (invalidate.args.data.frame === beginData.frame));
38 InspectorTest.log('dirtyObjects > 0: ' + (beginData.dirtyObjects > 0));
39 InspectorTest.log('totalObjects > 0: ' + (beginData.totalObjects > 0));
40
41 var endData = layoutEnd.args.endData;
42 InspectorTest.log('has rootNode id: ' + (endData.rootNode > 0));
43 InspectorTest.log('has root quad: ' + !!endData.root);
44
45 InspectorTest.log('SUCCESS: found all expected events.');
46 InspectorTest.completeTest();
47 }
48 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698