mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1116382 test auto-revoking behavior with URL.createObjectURL(MediaSource) r=bholley
This commit is contained in:
parent
7e2353ac43
commit
cc5c7cf737
@ -155,8 +155,7 @@ URL::CreateObjectURL(const GlobalObject& aGlobal, MediaSource& aSource,
|
||||
nsHostObjectProtocolHandler::RemoveDataEntry(url);
|
||||
});
|
||||
|
||||
rv = nsContentUtils::RunInStableState(revocation);
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv), "RunInStableState() failure");
|
||||
nsContentUtils::RunInStableState(revocation.forget());
|
||||
|
||||
CopyASCIItoUTF16(url, aResult);
|
||||
}
|
||||
|
@ -38,6 +38,22 @@ async_test(function(t) {
|
||||
video.removeEventListener('error', unexpectedErrorHandler);
|
||||
}));
|
||||
}, "Check referenced MediaSource can open after URL.revokeObjectURL(url).");
|
||||
async_test(function(t) {
|
||||
var mediaSource = new MediaSource();
|
||||
var url = window.URL.createObjectURL(mediaSource);
|
||||
setTimeout(function() {
|
||||
mediaSource.addEventListener('sourceopen',
|
||||
t.unreached_func("url should not reference MediaSource."));
|
||||
var video = document.createElement('video');
|
||||
video.src = url;
|
||||
video.addEventListener('error', t.step_func_done(function(e) {
|
||||
assert_equals(e.target.error.code,
|
||||
MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED,
|
||||
'Expected error code');
|
||||
assert_equals(mediaSource.readyState, 'closed');
|
||||
}));
|
||||
}, 0);
|
||||
}, "Check auto-revoking behavior with URL.createObjectURL(MediaSource).");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user