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

Side by Side Diff: LayoutTests/fast/canvas/script-tests/canvas-lost-gpu-context.js

Issue 16032003: Fixing Canvas2DLayerBridge to handle lost graphics contexts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added Layout test and necessary content_shell API to test context loss Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 description("Test the behavior of canvas recovery after a gpu context loss");
2
3 if (window.internals && window.testRunner) {
4 window.testRunner.dumpAsText();
5 var ctx = document.createElement('canvas').getContext('2d');
6 document.body.appendChild(ctx.canvas);
7 ctx.fillStyle = '#f00';
8 ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
9 // context loss is a no-op when not gpu-acelerated, which is fine for this t est
10 window.internals.loseSharedGraphicsContext3D();
Stephen White 2013/06/18 18:06:57 I wonder if we should do this four times, to test
11 //Verify that buffer automatically recovers to a usable state
12 ctx.fillStyle = '#0f0';
13 ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
14 imageData = ctx.getImageData(0, 0, 1, 1);
15 imgdata = imageData.data;
16 shouldBe("imgdata[0]", "0");
17 shouldBe("imgdata[1]", "255");
18 shouldBe("imgdata[2]", "0");
19 shouldBe("imgdata[3]", "255");
20 } else {
21 testFailed('This test requires window.internals and window.testRunner.');
22 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/canvas/canvas-lost-gpu-context-expected.txt ('k') | Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698