summaryrefslogtreecommitdiffstats
path: root/dom/media/mediasession/test/crashtests/inactive-mediasession.html
blob: b24fb887ffdc6655846c45ee152f3e7cce3e7c57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<html>
<head></head>
<script>
const frame = document.createElementNS('http://www.w3.org/1999/xhtml', 'frame');
document.documentElement.appendChild(frame);

const windowPointer = frame.contentWindow;
document.documentElement.replaceWith();

// Setting attributes on inactive media session should not cause crash.
windowPointer.navigator.mediaSession.setActionHandler('nexttrack', null);
windowPointer.navigator.mediaSession.playbackState = "playing";
windowPointer.navigator.mediaSession.setPositionState();
windowPointer.navigator.mediaSession.metadata = null;
</script>
</html>