Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1338)

Unified Diff: content/test/data/gpu/webgl.html

Issue 560023002: gpu: Add test for losing a context in a background tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}
« no previous file with comments | « no previous file | content/test/gpu/gpu_tests/context_lost.py » ('j') | content/test/gpu/gpu_tests/context_lost.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698