-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
tests: update create-test-trace utility #13942
Conversation
|
||
return { | ||
GatherContext: {gatherMode: 'navigation'}, | ||
traces: {defaultPass: createTestTrace({traceEnd: 5000})}, | ||
traces: {defaultPass: createTestTrace({frameUrl, traceEnd: 5000})}, |
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.
a few of these tests were accidentally relying on the fact that the redirects audit was only using navStart events for the redirect chain if they have a isLoadingMainFrame
property, and create-test-trace
wasn't setting that property. The generated navStart event now has that property and these tests now set the navStart documentLoaderURL
properly
@@ -298,7 +298,7 @@ describe('Metrics: CLS', () => { | |||
|
|||
it('ignores layout shift data from other tabs', async () => { | |||
const trace = createTestTrace({timeOrigin: 0, traceEnd: 2000}); | |||
const mainFrame = trace.traceEvents[0].args.frame; | |||
const mainFrame = trace.traceEvents.find(e => e.name === 'navigationStart').args.frame; |
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 mainFrame
changes are a little awkward (and one reason why we should consider an ease of use refactor at some point), but still straightforward. navStart
isn't necessarily the first event.
tid, | ||
ph: 'I', | ||
cat: 'disabled-by-default-devtools.timeline', | ||
args: { | ||
data: { | ||
frameTreeNodeId: 6, | ||
persistentIds: true, | ||
frames: [{frame: rootFrame, url: frameUrl, name: '', processId: pid}], | ||
frames: [{frame: rootFrame, url: 'about:blank', name: '', processId: pid}], |
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.
now defintely a navigation trace. we could adjust that if needed at some point
While working on #13917 I noticed
create-test-trace
has some very outdated details and wanted to fix them before it all paged out of my brain. There's a much nicer and powerful API possible here, but this PR is just some surface-level fixes to get the generated test traces closer to real traces.