@@ -8,7 +8,7 @@ import {TraceLoader} from '../../../testing/TraceLoader.js';
88import * as Helpers from '../helpers/helpers.js' ;
99import * as Types from '../types/types.js' ;
1010
11- import { InsightRunners } from './insights.js' ;
11+ import { Models } from './insights.js' ;
1212
1313export async function processTrace ( testContext : Mocha . Suite | Mocha . Context | null , traceFile : string ) {
1414 const { parsedTrace, insights} = await TraceLoader . traceEngine ( testContext , traceFile ) ;
@@ -22,12 +22,12 @@ export async function processTrace(testContext: Mocha.Suite|Mocha.Context|null,
2222// Root cause invalidation window.
2323const INVALIDATION_WINDOW = Helpers . Timing . secondsToMicroseconds ( Types . Timing . Seconds ( 0.5 ) ) ;
2424
25- describeWithEnvironment ( 'CumulativeLayoutShift ' , function ( ) {
25+ describeWithEnvironment ( 'CLSCulprits ' , function ( ) {
2626 describe ( 'non composited animations' , function ( ) {
2727 it ( 'gets the correct non composited animations' , async function ( ) {
2828 const { data, insights} = await processTrace ( this , 'non-composited-animation.json.gz' ) ;
2929 const firstNav = getFirstOrError ( data . Meta . navigationsByNavigationId . values ( ) ) ;
30- const insight = getInsightOrError ( 'CumulativeLayoutShift ' , insights , firstNav ) ;
30+ const insight = getInsightOrError ( 'CLSCulprits ' , insights , firstNav ) ;
3131 const { animationFailures} = insight ;
3232
3333 const simpleAnimation = data . Animations . animations . find ( animation => {
@@ -37,18 +37,18 @@ describeWithEnvironment('CumulativeLayoutShift', function() {
3737 return animation . args . data . beginEvent . args . data . displayName === 'top' ;
3838 } ) ;
3939
40- const expected : InsightRunners . CumulativeLayoutShift . NoncompositedAnimationFailure [ ] = [
40+ const expected : Models . CLSCulprits . NoncompositedAnimationFailure [ ] = [
4141 {
4242 name : 'simple-animation' ,
43- failureReasons : [ InsightRunners . CumulativeLayoutShift . AnimationFailureReasons . UNSUPPORTED_CSS_PROPERTY ] ,
43+ failureReasons : [ Models . CLSCulprits . AnimationFailureReasons . UNSUPPORTED_CSS_PROPERTY ] ,
4444 unsupportedProperties : [ 'color' ] ,
4545 animation : simpleAnimation ,
4646 } ,
4747 {
4848 name : 'top' ,
4949 failureReasons : [
50- InsightRunners . CumulativeLayoutShift . AnimationFailureReasons . TARGET_HAS_INVALID_COMPOSITING_STATE ,
51- InsightRunners . CumulativeLayoutShift . AnimationFailureReasons . UNSUPPORTED_CSS_PROPERTY ,
50+ Models . CLSCulprits . AnimationFailureReasons . TARGET_HAS_INVALID_COMPOSITING_STATE ,
51+ Models . CLSCulprits . AnimationFailureReasons . UNSUPPORTED_CSS_PROPERTY ,
5252 ] ,
5353 unsupportedProperties : [ 'top' ] ,
5454 animation : top ,
@@ -60,7 +60,7 @@ describeWithEnvironment('CumulativeLayoutShift', function() {
6060 it . skip ( '[crbug.com/370382177]: gets the correct non composited animations for shift' , async function ( ) {
6161 const { data, insights} = await processTrace ( this , 'non-composited-animation-shift.json.gz' ) ;
6262 const firstNav = getFirstOrError ( data . Meta . navigationsByNavigationId . values ( ) ) ;
63- const insight = getInsightOrError ( 'CumulativeLayoutShift ' , insights , firstNav ) ;
63+ const insight = getInsightOrError ( 'CLSCulprits ' , insights , firstNav ) ;
6464 const { shifts, animationFailures} = insight ;
6565
6666 const simpleAnimation = data . Animations . animations . find ( animation => {
@@ -70,30 +70,30 @@ describeWithEnvironment('CumulativeLayoutShift', function() {
7070 return animation . args . data . beginEvent . args . data . displayName === 'top' ;
7171 } ) ;
7272
73- const shiftAnimations : InsightRunners . CumulativeLayoutShift . NoncompositedAnimationFailure [ ] = [ ] ;
73+ const shiftAnimations : Models . CLSCulprits . NoncompositedAnimationFailure [ ] = [ ] ;
7474 shifts . forEach ( entry => {
7575 shiftAnimations . push ( ...entry . nonCompositedAnimations ) ;
7676 } ) ;
77- const expectedWithShift : InsightRunners . CumulativeLayoutShift . NoncompositedAnimationFailure [ ] = [
77+ const expectedWithShift : Models . CLSCulprits . NoncompositedAnimationFailure [ ] = [
7878 {
7979 name : 'simple-animation' ,
80- failureReasons : [ InsightRunners . CumulativeLayoutShift . AnimationFailureReasons . UNSUPPORTED_CSS_PROPERTY ] ,
80+ failureReasons : [ Models . CLSCulprits . AnimationFailureReasons . UNSUPPORTED_CSS_PROPERTY ] ,
8181 unsupportedProperties : [ 'height' , 'color' , 'top' ] ,
8282 animation : simpleAnimation ,
8383 } ,
8484 ] ;
8585 assert . deepStrictEqual ( shiftAnimations , expectedWithShift ) ;
8686
87- const expectedAll : InsightRunners . CumulativeLayoutShift . NoncompositedAnimationFailure [ ] = [
87+ const expectedAll : Models . CLSCulprits . NoncompositedAnimationFailure [ ] = [
8888 {
8989 name : 'simple-animation' ,
90- failureReasons : [ InsightRunners . CumulativeLayoutShift . AnimationFailureReasons . UNSUPPORTED_CSS_PROPERTY ] ,
90+ failureReasons : [ Models . CLSCulprits . AnimationFailureReasons . UNSUPPORTED_CSS_PROPERTY ] ,
9191 unsupportedProperties : [ 'height' , 'color' , 'top' ] ,
9292 animation : simpleAnimation ,
9393 } ,
9494 {
9595 name : 'top' ,
96- failureReasons : [ InsightRunners . CumulativeLayoutShift . AnimationFailureReasons . UNSUPPORTED_CSS_PROPERTY ] ,
96+ failureReasons : [ Models . CLSCulprits . AnimationFailureReasons . UNSUPPORTED_CSS_PROPERTY ] ,
9797 unsupportedProperties : [ 'top' ] ,
9898 animation : top ,
9999 } ,
@@ -105,7 +105,7 @@ describeWithEnvironment('CumulativeLayoutShift', function() {
105105 it ( 'returns no insights when there are no non-composited animations' , async function ( ) {
106106 const { data, insights} = await processTrace ( this , 'lcp-images.json.gz' ) ;
107107 const firstNav = getFirstOrError ( data . Meta . navigationsByNavigationId . values ( ) ) ;
108- const insight = getInsightOrError ( 'CumulativeLayoutShift ' , insights , firstNav ) ;
108+ const insight = getInsightOrError ( 'CLSCulprits ' , insights , firstNav ) ;
109109 const { animationFailures} = insight ;
110110
111111 assert . isEmpty ( animationFailures ) ;
@@ -115,7 +115,7 @@ describeWithEnvironment('CumulativeLayoutShift', function() {
115115 it ( 'returns correct layout shifts' , async function ( ) {
116116 const { data, insights} = await processTrace ( this , 'cls-single-frame.json.gz' ) ;
117117 const firstNav = getFirstOrError ( data . Meta . navigationsByNavigationId . values ( ) ) ;
118- const insight = getInsightOrError ( 'CumulativeLayoutShift ' , insights , firstNav ) ;
118+ const insight = getInsightOrError ( 'CLSCulprits ' , insights , firstNav ) ;
119119 const { shifts} = insight ;
120120
121121 assert . exists ( shifts ) ;
@@ -127,7 +127,7 @@ describeWithEnvironment('CumulativeLayoutShift', function() {
127127 // Trace has a single iframe that gets created before the first layout shift and causes a layout shift.
128128 const { data, insights} = await processTrace ( this , 'iframe-shift.json.gz' ) ;
129129 const firstNav = getFirstOrError ( data . Meta . navigationsByNavigationId . values ( ) ) ;
130- const insight = getInsightOrError ( 'CumulativeLayoutShift ' , insights , firstNav ) ;
130+ const insight = getInsightOrError ( 'CLSCulprits ' , insights , firstNav ) ;
131131 const { shifts} = insight ;
132132
133133 assert . exists ( shifts ) ;
@@ -159,7 +159,7 @@ describeWithEnvironment('CumulativeLayoutShift', function() {
159159 // Trace has font load before the second layout shift.
160160 const { data, insights} = await processTrace ( this , 'iframe-shift.json.gz' ) ;
161161 const firstNav = getFirstOrError ( data . Meta . navigationsByNavigationId . values ( ) ) ;
162- const insight = getInsightOrError ( 'CumulativeLayoutShift ' , insights , firstNav ) ;
162+ const insight = getInsightOrError ( 'CLSCulprits ' , insights , firstNav ) ;
163163 const { shifts} = insight ;
164164
165165 assert . exists ( shifts ) ;
@@ -193,7 +193,7 @@ describeWithEnvironment('CumulativeLayoutShift', function() {
193193 it ( 'handles potential unsized images root cause correctly' , async function ( ) {
194194 const { data, insights} = await processTrace ( this , 'unsized-images.json.gz' ) ;
195195 const firstNav = getFirstOrError ( data . Meta . navigationsByNavigationId . values ( ) ) ;
196- const insight = getInsightOrError ( 'CumulativeLayoutShift ' , insights , firstNav ) ;
196+ const insight = getInsightOrError ( 'CLSCulprits ' , insights , firstNav ) ;
197197 const { shifts} = insight ;
198198 assert . exists ( shifts ) ;
199199 assert . strictEqual ( shifts . size , 2 ) ;
@@ -217,7 +217,7 @@ describeWithEnvironment('CumulativeLayoutShift', function() {
217217 it ( 'returns clusters correctly' , async function ( ) {
218218 const { data, insights} = await processTrace ( this , 'iframe-shift.json.gz' ) ;
219219 const firstNav = getFirstOrError ( data . Meta . navigationsByNavigationId . values ( ) ) ;
220- const insight = getInsightOrError ( 'CumulativeLayoutShift ' , insights , firstNav ) ;
220+ const insight = getInsightOrError ( 'CLSCulprits ' , insights , firstNav ) ;
221221 const { shifts, clusters} = insight ;
222222
223223 assert . exists ( clusters ) ;
@@ -233,7 +233,7 @@ describeWithEnvironment('CumulativeLayoutShift', function() {
233233
234234 it ( 'returns clusters correctly for non-navigations' , async function ( ) {
235235 const { insights} = await processTrace ( this , 'cls-no-nav.json.gz' ) ;
236- const insight = getInsightOrError ( 'CumulativeLayoutShift ' , insights ) ;
236+ const insight = getInsightOrError ( 'CLSCulprits ' , insights ) ;
237237 const { shifts, clusters} = insight ;
238238
239239 assert . exists ( clusters ) ;
0 commit comments