Skip to content

Commit

Permalink
Bug 1668248 - Test that DataChannel.send fails gracefully when the ar…
Browse files Browse the repository at this point in the history
…gument is too big. r=bwc

Differential Revision: https://phabricator.services.mozilla.com/D91930
  • Loading branch information
padenot committed Oct 2, 2020
1 parent 0664e08 commit e805e98
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dom/media/tests/crashtests/datachannel-oom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="application/javascript">
function start() {
var size = 2147483638;
new RTCPeerConnection().createDataChannel('a').send(new Uint8Array(size));
var a = "a";
var count = Math.floor(Math.log2(size)) - 1;
for (var i = 0; i < count; i++) {
a += a;
}
new RTCPeerConnection().createDataChannel('a').send(a)
}
</script>
</head>

<body onload="start()">
</body>
</html>

0 comments on commit e805e98

Please sign in to comment.