Hey Michael and Hongchan, could you PTAL? Thanks!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks for the good cleaning up! The logic looks pretty simple now.
I’ve added some notes regarding the new tests. It would be great to run them through a formatter/linter. We want to keep these examples clean, as they frequently become the standard reference for the developers.
DLOG(ERROR) << "AudioContext::OnFrameHidden";DLOG(ERROR) is for debugging. Do you think we need this?
DLOG(ERROR) << "AudioContext::OnFrameShown";Ditto.
<title>Test the behavior of AudioContext with the media-playback-while-not-rendered permission policy</title>Can we do column wrap at 80?
// The tests in this file depend on
//resources/media-playback-while-not-visible-permission-policy-iframe.htmlIt looks like we have some formatting issues in test files. Can you format/lint them?
let iframe = document.createElement('iframe');Use `const` when possible.
</body>Add a new line at the end of the file.
window.addEventListener('message', (event) => {Can this be async? Also we can use await below.
setTimeout(() => {
window.removeEventListener('message', expectStateChangeEvent);
resolve('no state change');
}, 500);I think we want to avoid using setTimeout, and use the primitive provided from testharness here.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Overall looks good, but I agree with Hongchan's comments about DLOG and formatting the tests.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Addressed the comments! PTAL again when convenient. Thanks!
DLOG(ERROR) is for debugging. Do you think we need this?
Sorry. Forgot to remove after finishing to debug. Done.
DLOG(ERROR) << "AudioContext::OnFrameShown";Gabriel BritoDitto.
Done
<title>Test the behavior of AudioContext with the media-playback-while-not-rendered permission policy</title>Can we do column wrap at 80?
Done
// The tests in this file depend on
//resources/media-playback-while-not-visible-permission-policy-iframe.htmlIt looks like we have some formatting issues in test files. Can you format/lint them?
Apparently, there is no tool to automatically format HTML files 😞 I did try to look for issues manually though. Hopefully I have been able to address all of them.
let iframe = document.createElement('iframe');Gabriel BritoUse `const` when possible.
Done. Also did the same for the other files.
Add a new line at the end of the file.
Done. Also added in the other files.
Can this be async? Also we can use await below.
Done
setTimeout(() => {
window.removeEventListener('message', expectStateChangeEvent);
resolve('no state change');
}, 500);I think we want to avoid using setTimeout, and use the primitive provided from testharness here.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks for the good cleaning up! The logic looks pretty simple now.
I’ve added some notes regarding the new tests. It would be great to run them through a formatter/linter. We want to keep these examples clean, as they frequently become the standard reference for the developers.
Totally get it. Pardon for not being as thorough. Hopefully everything has been addressed now.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Mostly formatting nits. Thanks for your patience!
TRACE_EVENT1("webaudio", "AudioContext::Create - allowed to start", "UUID",
audio_context->Uuid());I guess these are artifacts of the linter. I think these are okay, but removing them makes the code review faster! 😊
TRACE_EVENT2("webaudio", __func__, "UUID", Uuid(), "state",
static_cast<int>(ContextState()));Ditto. Can we revert these non-functional changes?
//resources/media-playback-while-not-visible-permission-policy-iframe.html```suggestion
// resources/media-playback-while-not-visible-permission-policy-iframe.html
```
if (document.readyState !=='complete'){```suggestion
if (document.readyState !== 'complete') {
```
window.addEventListener('load', resolve)
})```suggestion
window.addEventListener('load', resolve);
});
```
if (document.readyState !=='complete'){It's a small thing, but the formatting should be:
```suggestion
if (document.readyState !== 'complete') {
```
await new Promise(resolve => {
window.addEventListener('load', resolve)
})```suggestion
await new Promise(resolve => {
window.addEventListener('load', resolve);
});
```
iframe.src = 'http://localhost:8000/webaudio/resources/media-playback-while-not-visible-permission-policy-iframe.html';```suggestion
iframe.src =
'http://localhost:8000/webaudio/resources/media-playback-while-not-visible-permission-policy-iframe.html';
```
iframe.addEventListener('load', resolve)
})```suggestion
iframe.addEventListener('load', resolve);
});
```
if (window.parent !== window){```suggestion
if (window.parent !== window) {
```
window.parent.postMessage(
{
operation: 'resume',
value: e.name
},
'*');Can we make this consistent with L28-L29?
const oscillator = audioCtx.createOscillator();I recommend using the newer constructor to the factory method.
```suggestion
const oscillator = new OscillatorNode(audioCtx);
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I am sorry for all the lint/formatting mistakes! I ran the JS portion of the CL through the `git cl format` tool. I think that it should look now. Could you PTAL again when you some time? Thanks!
TRACE_EVENT1("webaudio", "AudioContext::Create - allowed to start", "UUID",
audio_context->Uuid());I guess these are artifacts of the linter. I think these are okay, but removing them makes the code review faster! 😊
Done
TRACE_EVENT2("webaudio", __func__, "UUID", Uuid(), "state",
static_cast<int>(ContextState()));Ditto. Can we revert these non-functional changes?
Done
//resources/media-playback-while-not-visible-permission-policy-iframe.htmlGabriel Brito```suggestion
// resources/media-playback-while-not-visible-permission-policy-iframe.html
```
Done
```suggestion
if (document.readyState !== 'complete') {
```
Done
```suggestion
window.addEventListener('load', resolve);
});
```
Done
It's a small thing, but the formatting should be:
```suggestion
if (document.readyState !== 'complete') {
```
Done
await new Promise(resolve => {
window.addEventListener('load', resolve)
})```suggestion
await new Promise(resolve => {
window.addEventListener('load', resolve);
});
```
Done
iframe.src = 'http://localhost:8000/webaudio/resources/media-playback-while-not-visible-permission-policy-iframe.html';```suggestion
iframe.src =
'http://localhost:8000/webaudio/resources/media-playback-while-not-visible-permission-policy-iframe.html';
```
Done
```suggestion
iframe.addEventListener('load', resolve);
});
```
Done
```suggestion
if (window.parent !== window) {
```
Done
window.parent.postMessage(
{
operation: 'resume',
value: e.name
},
'*');Can we make this consistent with L28-L29?
Done
I recommend using the newer constructor to the factory method.
```suggestion
const oscillator = new OscillatorNode(audioCtx);
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |