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

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

Issue 715413003: Layout test for validating GLinfo on webglcontextcreationerror. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/webgl/webgl-error-response-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/canvas/webgl/webgl-error-response.html
diff --git a/LayoutTests/fast/canvas/webgl/webgl-error-response.html b/LayoutTests/fast/canvas/webgl/webgl-error-response.html
new file mode 100644
index 0000000000000000000000000000000000000000..79410177a2839e113a8a457263139f4fc74feb07
--- /dev/null
+++ b/LayoutTests/fast/canvas/webgl/webgl-error-response.html
@@ -0,0 +1,42 @@
+<!-- This is a test for crbug.com/412440, tests meaningful information in
+WebGL context creation error message. -->
+<script src="../../../resources/js-test.js"></script>
+<canvas id="webgl-canvas" width="200" height="200" class="nomargin"></canvas>
+<script>
+function main()
+{
+ if (!window.testRunner) {
+ testFailed("Requires window.testRunner");
+ } else {
+ initTest();
+ }
+}
+
+function initTest() {
+ var canvas = document.getElementById("webgl-canvas");
+ testRunner.forceNextWebGLContextCreationToFail();
+ canvas.addEventListener("webglcontextcreationerror", onContextCreationError, false);
+ var gl = canvas.getContext("webgl");
+ testRunner.dumpAsText();
+}
+
+function onContextCreationError(e) {
+ var vendorInfoStr = "VendorInfo = ";
+ var renderInfoStr = "RendererInfo = ";
+ var driverInfoStr = "DriverInfo = ";
+ var stringIndex = e.statusMessage.search(vendorInfoStr) + vendorInfoStr.length;
+ var vendorInfo = e.statusMessage.substring(stringIndex, e.statusMessage.search(renderInfoStr) - 2);
+ stringIndex = e.statusMessage.search(renderInfoStr) + renderInfoStr.length;
+ var rendererInfo = e.statusMessage.substring(stringIndex, e.statusMessage.search(driverInfoStr) - 2 );
+ stringIndex = e.statusMessage.search(driverInfoStr) + driverInfoStr.length;
+ var driverInfo = e.statusMessage.substring(stringIndex, e.statusMessage.length - 1);
+ if((e.statusMessage.search("GPUInfoCollectionFailure") != -1) ||
+ vendorInfo.length > 0 ||
+ rendererInfo.length > 0 ||
+ driverInfo.length > 0)
+ testPassed("Status message displayed for webglcontextcreationerror");
+ else
+ testFailed("Context creation error test failed");
+}
+main();
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/webgl/webgl-error-response-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698