3 <script type="text/javascript">
5 // For some reason, when running this test in automated fashion, it
6 // triggers the bug reliably if the first frame with back-to-back
7 // events happens a certain number of frames into the test execution.
10 var contextWasLost = false;
12 function contextLostHandler(e) {
13 contextWasLost = true;
17 if (--intensity == 0) {
21 gl.clearColor(intensity / 255.0, 0, 0, 1);
22 gl.clear(gl.COLOR_BUFFER_BIT);
24 if (numFrames % 2 == 0) {
25 // Toggle the state of the drop-down every other frame. Every now
26 // and then, dispatch two events back to back. This really seems to
29 if (numFrames % 6 == 0) {
32 for (var ii = 0; ii < maxIteration; ++ii) {
33 var e = document.createEvent('MouseEvent');
34 e.initMouseEvent('mousedown', true, true, window);
35 var s = document.getElementById('dropdown');
40 if (--numFrames > 0) {
41 requestAnimationFrame(draw);
44 window.domAutomationController.send("FAILED");
46 window.domAutomationController.send("SUCCESS");
52 window.domAutomationController.send("LOADED");
54 var canvas = document.getElementById("canvas1");
57 canvas.addEventListener("webglcontextlost", contextLostHandler, false);
59 gl = canvas.getContext("webgl");
63 requestAnimationFrame(draw);
67 <body onload="onLoad()">
68 <select id="dropdown">
69 <option value="option1">option1</option>
70 <option value="option2">option2</option>
71 <option value="option3">option3</option>
72 <option value="option4">option4</option>
74 <canvas id="canvas1" width="32px" height="32px">