Skip to content

Conversation

@connorjclark
Copy link
Collaborator

Fixes #14549

Also added some tests to ensure things are working as far back as v3. The viewer had the best setup for this (it using puppeteer), so I wrote the tests there.

@connorjclark connorjclark requested a review from a team as a code owner December 15, 2022 22:49
@connorjclark connorjclark requested review from adamraine and removed request for a team December 15, 2022 22:49
}
}

// TODO: convert printf-style displayValue.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this TODO for this PR or later?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an optional, p100 thing :P just something I noticed and wanted to document in the relevant place.

Comment on lines +279 to +282
const waitForAck = viewerPage.evaluate(() =>
new Promise(resolve =>
document.addEventListener('lh-file-upload-test-ack', resolve, {once: true})));
await fileInput.uploadFile(`${LH_ROOT}/report/test-assets/${testFilename}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this promise structure guarantees that the event listener is installed by the time we call fileInput.uploadFile.

Copy link
Collaborator Author

@connorjclark connorjclark Jan 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protocol commands are executed in sequence, so why wouldn't this be alright? the callback inside the promise is a microtask, but I think even then it runs on the main thread and so would any commands called by fileInput.upload so should be all good

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protocol commands are executed in sequence

Interesting, did not know this. This is probably fine then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Old v3 LHR fails to render in viewer

3 participants