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

Side by Side Diff: content/test/data/gpu/webgl.html

Issue 11378008: Raise an infobar and deny access to WebGL if a GPU reset was detected while a web page containing W… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Work around build failure on Mac OS with 10.6 SDK. Created 8 years, 1 month 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
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript"> 3 <script type="text/javascript">
4 var canvas; 4 var canvas;
5 var w, h; 5 var w, h;
6 var gl; 6 var gl;
7 var extension; 7 var extension;
8 8
9 function testHorizontalBands() { 9 function testHorizontalBands() {
10 gl.enable(gl.SCISSOR_TEST); 10 gl.enable(gl.SCISSOR_TEST);
(...skipping 21 matching lines...) Expand all
32 if (extension) { 32 if (extension) {
33 setTimeout(function() { 33 setTimeout(function() {
34 extension.restoreContext(); 34 extension.restoreContext();
35 }, 0); 35 }, 0);
36 } 36 }
37 } 37 }
38 38
39 function testContextRestored() { 39 function testContextRestored() {
40 gl = canvas.getContext("experimental-webgl"); 40 gl = canvas.getContext("experimental-webgl");
41 if (!gl || gl.isContextLost()) { 41 if (!gl || gl.isContextLost()) {
42 document.title = "FAILED: could not get recovered context"; 42 // Might just be blocked because of infobar.
43 return; 43 return;
44 } 44 }
45 gl.clearColor(0, 0, 1, 1); 45 gl.clearColor(0, 0, 1, 1);
46 gl.clear(gl.COLOR_BUFFER_BIT); 46 gl.clear(gl.COLOR_BUFFER_BIT);
47 47
48 var a = new Uint8Array(w * h * 4); 48 var a = new Uint8Array(w * h * 4);
49 gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, a); 49 gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, a);
50 50
51 window.domAutomationController.setAutomationId(1); 51 window.domAutomationController.setAutomationId(1);
52 if (a[0] == 0 && a[1] == 0 && a[2] == 255) 52 if (a[0] == 0 && a[1] == 0 && a[2] == 255)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 document.title = "SUCCESS: " + renderer; 101 document.title = "SUCCESS: " + renderer;
102 } 102 }
103 } 103 }
104 </script> 104 </script>
105 </head> 105 </head>
106 <body onload="onLoad()"> 106 <body onload="onLoad()">
107 <canvas id="canvas1" width="16px" height="32px"> 107 <canvas id="canvas1" width="16px" height="32px">
108 </canvas> 108 </canvas>
109 </body> 109 </body>
110 </html> 110 </html>
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698