| if (window.GCController) { |
| for (var ndx = 0; ndx < 99000; ndx++) |
| var numbers = new Float64Array(50 * 1024); |
| contexts.push(document.createElement("canvas").getContext("webgl")); |
| testRunner.waitUntilDone(); |
| var maxNumberOfActiveContexts = 16; |
| // Create the max number of active WebGL contexts. |
| while (contexts.length < maxNumberOfActiveContexts) |
| // Now remove some of those contexts from this array so they may be garbage collected. |
| while (contexts.length > contextsToKeep) { |
| // Add contexts until we get to the limit then add one more. This should only |
| // produce a single warning that an older context will be lost. |
| while (contexts.length < maxNumberOfActiveContexts + 1) |