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

Side by Side Diff: LayoutTests/fast/canvas/webgl/webgl-error-response.html

Issue 826363002: Webgl Info should have vendorid and deviceid of gpu. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code rework. Created 5 years, 10 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
OLDNEW
1 <!-- This is a test for crbug.com/412440, tests meaningful information in 1 <!-- This is a test for crbug.com/412440, tests meaningful information in
2 WebGL context creation error message. --> 2 WebGL context creation error message. -->
3 <script src="../../../resources/js-test.js"></script> 3 <script src="../../../resources/js-test.js"></script>
4 <canvas id="webgl-canvas" width="200" height="200" class="nomargin"></canvas> 4 <canvas id="webgl-canvas" width="200" height="200" class="nomargin"></canvas>
5 <script> 5 <script>
6 function main() 6 function main()
7 { 7 {
8 if (!window.testRunner) { 8 if (!window.testRunner) {
9 testFailed("Requires window.testRunner"); 9 testFailed("Requires window.testRunner");
10 } else { 10 } else {
11 initTest(); 11 initTest();
12 } 12 }
13 } 13 }
14 14
15 function initTest() { 15 function initTest() {
16 var canvas = document.getElementById("webgl-canvas"); 16 var canvas = document.getElementById("webgl-canvas");
17 testRunner.forceNextWebGLContextCreationToFail(); 17 testRunner.forceNextWebGLContextCreationToFail();
18 canvas.addEventListener("webglcontextcreationerror", onContextCreationError, f alse); 18 canvas.addEventListener("webglcontextcreationerror", onContextCreationError, f alse);
19 var gl = canvas.getContext("webgl"); 19 var gl = canvas.getContext("webgl");
20 testRunner.dumpAsText(); 20 testRunner.dumpAsText();
21 } 21 }
22 22
23 function onContextCreationError(e) { 23 function onContextCreationError(e) {
24 var vendorInfoStr = "VendorInfo = "; 24 var splitStatus = e.statusMessage.split(",");
25 var renderInfoStr = "RendererInfo = "; 25 var stringLocator = 1;
26 var driverInfoStr = "DriverInfo = "; 26 var status = true;
27 var stringIndex = e.statusMessage.search(vendorInfoStr) + vendorInfoStr.length ; 27 for (var i = 0; i < splitStatus.length; i++) {
28 var vendorInfo = e.statusMessage.substring(stringIndex, e.statusMessage.search (renderInfoStr) - 2); 28 var gpuInfoStr = splitStatus[i].split(" = ");
29 stringIndex = e.statusMessage.search(renderInfoStr) + renderInfoStr.length; 29 if (gpuInfoStr[stringLocator].length > 0)
Ken Russell (switch to Gerrit) 2015/02/13 17:32:58 Looking at this again I'm not sure it does what yo
sivag 2015/02/16 15:00:18 Done.
30 var rendererInfo = e.statusMessage.substring(stringIndex, e.statusMessage.sear ch(driverInfoStr) - 2 ); 30 status = true;
31 stringIndex = e.statusMessage.search(driverInfoStr) + driverInfoStr.length; 31 else
32 var driverInfo = e.statusMessage.substring(stringIndex, e.statusMessage.length - 1); 32 status = false;
33 if((e.statusMessage.search("GPUInfoCollectionFailure") != -1) || 33 }
34 vendorInfo.length > 0 || 34 if(status)
35 rendererInfo.length > 0 ||
36 driverInfo.length > 0)
37 testPassed("Status message displayed for webglcontextcreationerror"); 35 testPassed("Status message displayed for webglcontextcreationerror");
38 else 36 else
39 testFailed("Context creation error test failed"); 37 testFailed("Context creation error test failed");
40 } 38 }
41 main(); 39 main();
42 </script> 40 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698