Commit c8f435b6 authored by Dale Curtis's avatar Dale Curtis Committed by Commit Bot

Tickle the GL context during context loss test to ensure loss event.

Seems that we may not get the webglcontextlost event unless a GL command
happens to fail after the context loss has occurred. Use a 250ms timer
to tickle the context until the webglcontextlost event occurs.

BUG=929012,929429

Change-Id: I191b2338f633612fc3b8206bf27f9a14c968bd23
Reviewed-on: https://chromium-review.googlesource.com/c/1459780
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630134}
parent 8c1981dd
......@@ -39,8 +39,14 @@ function CrashGpuProcess() {
var canvas = document.createElement('canvas');
var gl = canvas.getContext('webgl');
// webglcontextlost may not be invoked unless we actually try to execute a GL
// command, so use a repeating function to tickle the context.
var tickle = setInterval(function() { gl.getParameter(gl.VERSION); }, 250);
// Now wait for the context loss before starting video playback.
canvas.addEventListener('webglcontextlost', function(e) {
clearInterval(tickle);
// Now wait for the video to play until the end, by which point a frame
// should be visible on screen.
video.addEventListener('ended', function(e) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment