Index: content/test/data/gpu/webgl.html |
diff --git a/content/test/data/gpu/webgl.html b/content/test/data/gpu/webgl.html |
index faa445d422e2b71122362b37633e6a68d348212f..2946981947e276d03106f641e3f5880dcaf803b3 100644 |
--- a/content/test/data/gpu/webgl.html |
+++ b/content/test/data/gpu/webgl.html |
@@ -100,12 +100,27 @@ function testQuantityLoss() { |
createAndDiscardContext(); |
} |
+function getLoseContextExtension() |
+{ |
+ return gl.getExtension("WEBKIT_WEBGL_lose_context") || |
+ gl.getExtension("WEBGL_lose_context"); |
+} |
+ |
+function loseContextUsingExtension() |
+{ |
+ getLoseContextExtension().loseContext(); |
+ // Report success at the next frame to give the compositor a chance to draw |
+ // using the lost context. |
+ window.requestAnimationFrame(function() { |
+ window.domAutomationController.send("SUCCESS"); |
+ }); |
+} |
+ |
function contextLostTest(kind) |
{ |
switch (kind) { |
case "WEBGL_lose_context": { |
- extension = gl.getExtension("WEBKIT_WEBGL_lose_context") || |
- gl.getExtension("WEBGL_lose_context"); |
+ extension = getLoseContextExtension(); |
extension.loseContext(); |
break; |
} |