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

Unified Diff: Source/core/html/canvas/WebGLRenderingContext.cpp

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
Index: Source/core/html/canvas/WebGLRenderingContext.cpp
diff --git a/Source/core/html/canvas/WebGLRenderingContext.cpp b/Source/core/html/canvas/WebGLRenderingContext.cpp
index 200dabb94acd0ea0fa82263972e808c8aee9ab6c..52f7ae846eca77ec778acd8a596392ebbac0f4e1 100644
--- a/Source/core/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContext.cpp
@@ -87,13 +87,32 @@ PassOwnPtrWillBeRawPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTML
OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::current()->createOffscreenGraphicsContext3D(wgc3dAttributes, 0, &glInfo));
if (!context || shouldFailContextCreationForTesting) {
shouldFailContextCreationForTesting = false;
- String statusMessage("Could not create a WebGL context for VendorInfo = ");
- statusMessage.append(glInfo.vendorInfo);
- statusMessage.append(", RendererInfo = ");
- statusMessage.append(glInfo.rendererInfo);
- statusMessage.append(", DriverInfo = ");
- statusMessage.append(glInfo.driverVersion);
- statusMessage.append(".");
+ String statusMessage;
+ if (!glInfo.contextInfoCollectionFailure.isEmpty()) {
+ statusMessage.append("Could not create a WebGL context. ");
+ statusMessage.append(glInfo.contextInfoCollectionFailure);
+ } else {
+ statusMessage.append("Could not create a WebGL context");
+ if (!glInfo.vendorInfo.isEmpty()) {
+ statusMessage.append(" VendorInfo = ");
+ statusMessage.append(glInfo.vendorInfo);
+ } else {
+ statusMessage.append(" VendorInfo = Not Available");
+ }
+ if (!glInfo.rendererInfo.isEmpty()) {
+ statusMessage.append(", RendererInfo = ");
+ statusMessage.append(glInfo.rendererInfo);
+ } else {
+ statusMessage.append(", RendererInfo = Not Available");
+ }
+ if (!glInfo.driverVersion.isEmpty()) {
+ statusMessage.append(", DriverInfo = ");
+ statusMessage.append(glInfo.driverVersion);
+ } else {
+ statusMessage.append(", DriverInfo = Not Available");
+ }
+ statusMessage.append(".");
+ }
canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, statusMessage));
return nullptr;
}
« no previous file with comments | « LayoutTests/fast/canvas/webgl/webgl-error-response-expected.txt ('k') | public/platform/WebGraphicsContext3D.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698