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
[ManagedMSE] JS ManagedSourceBuffer object doesn't present any of its attributes #14092
Conversation
EWS run on previous version of this PR (hash a7170c4) |
EWS run on previous version of this PR (hash e9b9d5c) |
@@ -37,6 +37,10 @@ | |||
run('sourceBuffer.appendBuffer(loader.initSegment())'); | |||
await waitFor(sourceBuffer, 'update'); | |||
|
|||
sourceBuffer.onbufferedchange = () => { |
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.
Testing isn't great. I'd add something like:
shouldBe("sourceBuffer.__proto__", "ManagedSourceBuffer.prototype");
shouldBeTrue("sourceBuffer.hasOwnProperty('onbufferedchange')");
Or whatever the equivalent is in media tests.
A test that doesn't FAIL when the property is missing is not a good test.
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.
it would have failed if the property was missing.
That's how I found the bug to start.
If the sourceBuffer object is actually a SourceBuffer
rather than a ManagedSourceBuffer
then the onbufferedchange
property doesn't exist to start, and so setting it does nothing.
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.
It wouldn't have failed, it would have given different output which could have easily been mistakenly rebaselined. It is bad practice. Please make it so that the test output contains a FAIL line if the property is missing.
|
||
#include "config.h" | ||
|
||
#if ENABLE(MANAGED_MEDIA_SOURCE) |
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.
This doesn't seem right.
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.
oh right...
EWS run on previous version of this PR (hash f0b9438) |
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.
LGTM % nits.
#if ENABLE(MANAGED_MEDIA_SOURCE) | ||
#include "JSManagedSourceBuffer.h" | ||
#endif | ||
#include "JSSourceBuffer.h" |
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.
First come the non guarded includes, then the guarded ones with a blank line in between, so it should look like:
#include "JSSourceBuffer.h"
#if ENABLE(MANAGED_MEDIA_SOURCE)
#include "JSManagedSourceBuffer.h"
#endif
@@ -35,6 +35,9 @@ | |||
waitFor(video, 'error').then(failTest); | |||
|
|||
run('sourceBuffer = source.addSourceBuffer(loader.type())'); | |||
testExpected('sourceBuffer.__proto__', ManagedSourceBuffer.prototype); | |||
testExpected('sourceBuffer.onbufferedchange !== undefined', true); |
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.
My comment was to add these checks in addition to your new event listener. Checking that the event listener gets called seemed useful too.
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.
indeed ; but right now there's another bug that makes it behave differently if the GPU process is turned on. I will fix it soon
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.
Oh, right. Fine.
EWS run on current version of this PR (hash f2252ea) |
β¦ attributes https://bugs.webkit.org/show_bug.cgi?id=257037 rdar://109569570 Reviewed by Chris Dumez. Add missing custom toJS for MediaSource and SourceBuffer. * LayoutTests/media/media-source/media-managedmse-bufferedchange-expected.txt: * LayoutTests/media/media-source/media-managedmse-bufferedchange.html: * Source/WebCore/Modules/mediasource/MediaSource.idl: * Source/WebCore/Modules/mediasource/SourceBuffer.idl: * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/bindings/js/JSMediaSourceCustom.cpp: Added. (WebCore::toJSNewlyCreated): (WebCore::toJS): * Source/WebCore/bindings/js/JSSourceBufferCustom.cpp: Added. (WebCore::toJSNewlyCreated): (WebCore::toJS): Canonical link: https://commits.webkit.org/264284@main
f2252ea
to
202d7e7
Compare
Committed 264284@main (202d7e7): https://commits.webkit.org/264284@main Reviewed commits have been landed. Closing PR #14092 and removing active labels. |
202d7e7
f2252ea
π§ͺ gtk-wk2π§ͺ api-iosπ§ͺ mac-AS-debug-wk2