summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/webaudio/audiocontext-max-contexts.html
blob: 655fd08567e12872fba8cdefee4364e0cebb597f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test.js"></script>
</head>
<body>
<script>
description("Check that the AudioContext constructor throws when the limit on hardware contexts is reached.");

function reachHardwareContextsLimit() {
    var context = [];
    for (var i=0; i<10; ++i) {
        context[i] = new webkitAudioContext();
        // Trigger lazy initialization.
        context[i].createBufferSource();
    }
}

shouldThrow("reachHardwareContextsLimit()");
</script>
</body>
</html>