3 <script type=
"text/javascript">
5 window
.domAutomationController
.reset = function() {
6 window
.domAutomationController
._loaded
= false;
7 window
.domAutomationController
._succeeded
= false;
8 window
.domAutomationController
._finished
= false;
9 window
.requestAnimationFrame(draw
);
11 window
.domAutomationController
.send("LOADED");
15 // Render some WebGL into a fresh canvas to ensure the GPU process
17 var canvas
= document
.createElement("canvas");
20 gl
= canvas
.getContext("webgl");
22 console
.log("Failed to fetch WebGL context");
23 window
.domAutomationController
.send("FAILED");
27 gl
.clearColor(1, 0, 0, 1);
28 gl
.clear(gl
.COLOR_BUFFER_BIT
);
29 var pixels
= new Uint8Array(4);
30 gl
.readPixels(0, 0, 1, 1, gl
.RGBA
, gl
.UNSIGNED_BYTE
, pixels
);
32 if (Math
.abs(pixels
[0] - 255) > tolerance
||
33 Math
.abs(pixels
[1] - 0) > tolerance
||
34 Math
.abs(pixels
[2] - 0) > tolerance
||
35 Math
.abs(pixels
[3] - 255) > tolerance
) {
36 console
.log("Expected (255, 0, 0, 255), got (" +
41 window
.domAutomationController
.send("FAILED");
45 window
.domAutomationController
.send("SUCCESS");
49 <body onload=
"onLoad()">
50 GPU process crash test running.