-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: extract BootupTime task summary methods #13971
Conversation
return MainThreadTasks.getMainThreadTasks(mainThreadEvents, frames, timestamps.traceEnd); | ||
} | ||
|
||
describe('Task Summaries', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these functions are quite well tested by the existing BootupTime et al tests, but only as integrated into the audit results, no unit tests, so it seemed appropriate to give some basic coverage since they're often used as units.
it('returns the script URLs from a set of network records', () => { | ||
const records = NetworkRecorder.recordsFromLogs(ampDevtoolsLog); | ||
const urls = getJavaScriptURLs(records); | ||
expect(urls.size).toEqual(13); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: when the size of an array changes it creates very unhelpful test failures messages. maybe just move this length check to after the for loop... or change toMatch to check an array in one-go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SG. It shouldn't ever change (until the trace does) but it would be more helpful.
part of #13916
The responsiveness debugging audit will be the fourth audit using these functions, so it's just about time we spin them off into their own file.
They're not quite
main-thread-task
functions, nor are they just abouttask-groups
, so a new file seemed appropriate. I'm not attached to their new location, however, so I'm happy to bikeshed.