mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1851829 - Do not send close messages for MIDI ports that have already been disconnected from their remote object r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D189361
This commit is contained in:
parent
0489f93a3d
commit
85dbd41802
@ -254,8 +254,10 @@ void MIDIPort::Receive(const nsTArray<MIDIMessage>& aMsg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MIDIPort::DisconnectFromOwner() {
|
void MIDIPort::DisconnectFromOwner() {
|
||||||
DontKeepAliveOnStatechange();
|
if (Port()) {
|
||||||
Port()->SendClose();
|
Port()->SendClose();
|
||||||
|
}
|
||||||
|
DontKeepAliveOnStatechange();
|
||||||
|
|
||||||
DOMEventTargetHelper::DisconnectFromOwner();
|
DOMEventTargetHelper::DisconnectFromOwner();
|
||||||
}
|
}
|
||||||
|
31
dom/midi/crashtests/1851829.html
Normal file
31
dom/midi/crashtests/1851829.html
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html class="reftest-wait">
|
||||||
|
<!--
|
||||||
|
https://bugzilla.mozilla.org/show_bug.cgi?id=1851829
|
||||||
|
-->
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Bug 1851829</title>
|
||||||
|
<script>
|
||||||
|
async function timeout (cmd) {
|
||||||
|
const timer = new Promise((resolve, reject) => {
|
||||||
|
const id = setTimeout(() => {
|
||||||
|
clearTimeout(id)
|
||||||
|
reject(new Error('Promise timed out!'))
|
||||||
|
}, 750)
|
||||||
|
})
|
||||||
|
return Promise.race([cmd, timer])
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('load', async () => {
|
||||||
|
// <script>window.close()<\/script>
|
||||||
|
const tab = window.open('data:text/plain;charset=utf-8;base64,PHNjcmlwdD53aW5kb3cuY2xvc2UoKTwvc2NyaXB0Pg==')
|
||||||
|
setTimeout(async () => {
|
||||||
|
try { await timeout(tab.navigator.requestMIDIAccess({})) } catch (e) {}
|
||||||
|
window.close()
|
||||||
|
document.documentElement.classList.remove("reftest-wait");
|
||||||
|
}, 400)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
</html>
|
1
dom/midi/crashtests/crashtests.list
Normal file
1
dom/midi/crashtests/crashtests.list
Normal file
File diff suppressed because one or more lines are too long
@ -25,6 +25,7 @@ include ../../dom/media/webvtt/test/crashtests/crashtests.list
|
|||||||
skip-if(!webrtc) include ../../dom/media/tests/crashtests/crashtests.list
|
skip-if(!webrtc) include ../../dom/media/tests/crashtests/crashtests.list
|
||||||
skip-if(!webrtc) include ../../dom/media/webrtc/tests/crashtests/crashtests.list
|
skip-if(!webrtc) include ../../dom/media/webrtc/tests/crashtests/crashtests.list
|
||||||
include ../../dom/media/webspeech/synth/crashtests/crashtests.list
|
include ../../dom/media/webspeech/synth/crashtests/crashtests.list
|
||||||
|
include ../../dom/midi/crashtests/crashtests.list
|
||||||
include ../../dom/plugins/test/crashtests/crashtests.list
|
include ../../dom/plugins/test/crashtests/crashtests.list
|
||||||
include ../../dom/security/test/crashtests/crashtests.list
|
include ../../dom/security/test/crashtests/crashtests.list
|
||||||
include ../../dom/serializers/crashtests/crashtests.list
|
include ../../dom/serializers/crashtests/crashtests.list
|
||||||
|
Loading…
Reference in New Issue
Block a user