2 <html class='reftest-wait'
>
5 <script type='text/javascript' src='webgl-utils.js'
></script>
9 <canvas id='e_canvas'
></canvas>
11 <div id='e_log'
></div>
15 * Create canvas of wrong size.
16 * Clear the canvas to red.
17 * Resize to correct size.
23 async
function awaitComposite() {
24 await
new Promise((res
, rej
) => {
25 waitForComposite(res
);
29 function testComplete() {
30 document
.documentElement
.removeAttribute('class');
34 const gl
= initGL(e_canvas
);
36 e_log
.textContent
= 'WebGL failed.';
38 gl
.clearColor(1.0, 0.0, 0.0, 1.0); // red
39 gl
.clear(gl
.COLOR_BUFFER_BIT
);
40 await
awaitComposite();
42 gl
.canvas
.width
= 256;
43 gl
.canvas
.height
= 256;
44 gl
.clearColor(0.0, 1.0, 0.0, 1.0); // green
45 gl
.clear(gl
.COLOR_BUFFER_BIT
);
48 await
awaitComposite();