This patch modifies the inspector protocol generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-inspector-generator-tests --reset-results`)
Comment on attachment 313380[details]
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=313380&action=review> Source/WebCore/ChangeLog:8
> + No new tests because this just adds extra values to an existing enum.
At minimum we should test that WebGL2 and WebGPU contexts are being instrumented. Adding two simple test cases to LayoutTests/inspector/canvas/create-canvas-contexts.html should be enough:
let simpleTestCases = [
...
{
name: "CreateWebGL2CanvasContext",
expression: `createCanvas("webgl2")`,
contextType: WebInspector.Canvas.ContextType.WebGL2,
},
{
name: "CreateWebGPUCanvasContext",
expression: `createCanvas("webgpu")`,
contextType: WebInspector.Canvas.ContextType.WebGPU,
}
];
For this to work, you'll need to add the following to your test:
if (window.internals) {
internals.settings.setWebGL2Enabled(true);
internals.settings.setWebGPUEnabled(true);
}
> Source/WebCore/inspector/InspectorCanvasAgent.cpp:274
> + else if (is<WebGL2RenderingContext>(context))
There is a separate WEBGL2 guard.
Created attachment 313477[details]
Archive of layout-test-results from ews115 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 313480[details]
Archive of layout-test-results from ews100 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 313494[details]
Archive of layout-test-results from ews101 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 313497[details]
Archive of layout-test-results from ews100 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 313499[details]
Archive of layout-test-results from ews117 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 313536[details]
Archive of layout-test-results from ews101 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 313537[details]
Archive of layout-test-results from ews114 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Comment on attachment 313528[details]
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=313528&action=review> LayoutTests/inspector/canvas/create-canvas-contexts.html:8
> + window.internals.settings.setWebGPUEnabled(true);
The WebGPU portions of this test are only going to pass if a port enables ENABLE_WEBGPU.
The WebGL2 portions of this test are only going to pass if a port enables ENABLE_WEBGL2.
I think some ports don't do this (GTK/Windows) so they would fail this test.
It might be easier to break these out into their own test that can be skipped per-port based on feature availability.
LayoutTests/inspector/canvas/canvas-contexts.html # if needed a test for multiple
LayoutTests/inspector/canvas/context-type-2d.html
LayoutTests/inspector/canvas/context-type-webgl.html
LayoutTests/inspector/canvas/context-type-webgl2.html
LayoutTests/inspector/canvas/context-type-webgpu.html
There is a way to share code between tests if you want to go that approach. Its up to you though if you want to go down this road.
--
I'm not sure why this test is timing out. You can add `InspectorTest.debug()`, attach a new patch, and when EWS fails, you can get the debug output.
Created attachment 314107[details]
Archive of layout-test-results from ews114 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 314149[details]
Archive of layout-test-results from ews101 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Attachment 314179[details] did not pass style-queue:
WARNING: Not running on native Windows.
ERROR: LayoutTests/platform/win/TestExpectations:2386: Path does not exist. [test/expectations] [5]
ERROR: LayoutTests/platform/ios/TestExpectations:45: Path does not exist. [test/expectations] [5]
ERROR: LayoutTests/platform/gtk/TestExpectations:1263: Path does not exist. [test/expectations] [5]
Total errors found: 3 in 22 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 314179[details]
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=314179&action=review
Very nice!
> LayoutTests/inspector/canvas/resources/create-context-utilities.js:69
> + name: suite.name + "." + name,
I'm on the fence about this. I think its fine, you are generating tests. But one of the things I've always tried to strive for is the ability to search our code for the name of a failing test case: "Canvas.CreateContextWebGPU.NoCanvases" and find the code associated with it. This breaks that, but I'm probably overblowing the usefulness. I don't think I've actually done this search many times.
> LayoutTests/inspector/canvas/resources/create-context-utilities.js:91
> + window.addCSSCanvasTestCase = function(contextType) {
It is my understanding that you can't change the context inside of a -webkit-canvas. Can you throw an error if this gets called more than once in a test?
Basically something like this:
let addedCSSCanvas = false;
window.addCSSCanvasTestCase = function(contextType) {
InspectorTest.assert(!addedCSSCanvas, "addCSSCanvasTestCase should only be called once in a test");
addedCSSCanvas = true;
... suite.addTestCase ...
});
> LayoutTests/platform/gtk/TestExpectations:1263
> +inspector/canvas/create-context-webpu.html [ Skip ]
This is a typo it should be webgpu.html
> LayoutTests/platform/ios/TestExpectations:45
> +inspector/canvas/create-context-webpu.html [ Skip ]
This is a typo it should be webgpu.html
> LayoutTests/platform/win/TestExpectations:2386
> +inspector/canvas/create-context-webpu.html [ Skip ]
Remove this line.
> Source/WebCore/inspector/InspectorCanvasAgent.cpp:49
> +#if ENABLE(WEBGL)
> +#if ENABLE(WEBGL2)
> +#include "WebGL2RenderingContext.h"
> +#endif
> #include "WebGLContextAttributes.h"
> +#include "WebGLRenderingContext.h"
> #include "WebGLRenderingContextBase.h"
> +#endif
> +
> +#if ENABLE(WEBGPU)
> +#include "WebGPURenderingContext.h"
> +#endif
This is a mess. I'd recommend not nesting WEBGL2 and WEBGL. Just:
#if ENABLE(WEBGL)
#include "WebGLRenderingContext.h"
#endif
#if ENABLE(WEBGL2)
#include "WebGLContextAttributes.h"
#include "WebGL2RenderingContext.h"
#include "WebGLRenderingContextBase.h"
#endif
#if ENABLE(WEBGPU)
#include "WebGPURenderingContext.h"
#endif
> Source/WebCore/inspector/InspectorCanvasAgent.cpp:52
> #include <inspector/IdentifiersFactory.h>
> #include <inspector/InspectorProtocolObjects.h>
Style: These would normally be next to line 36.
> Source/WebCore/inspector/InspectorCanvasAgent.cpp:283
> +#if ENABLE(WEBGL)
> + else if (is<WebGLRenderingContext>(context))
> contextType = Inspector::Protocol::Canvas::ContextType::WebGL;
> +#if ENABLE(WEBGL2)
> + else if (is<WebGL2RenderingContext>(context))
> + contextType = Inspector::Protocol::Canvas::ContextType::WebGL2;
> +#endif
> +#endif
Likewise this doesn't need to nest and it becomes much more readable:
#if ENABLE(WEBGL)
else if (is<WebGLRenderingContext>(context))
contextType = Inspector::Protocol::Canvas::ContextType::WebGL;
#endif
#if ENABLE(WEBGL2)
else if (is<WebGL2RenderingContext>(context))
contextType = Inspector::Protocol::Canvas::ContextType::WebGL2;
#endif
#if ENABLE(WEBGPU)
else if (is<WebGPURenderingContext>(context))
contextType = Inspector::Protocol::Canvas::ContextType::WebGPU;
#endif
> Source/WebInspectorUI/UserInterface/Models/Canvas.js:189
> Canvas2D: "canvas-2d",
> WebGL: "webgl",
> + WebGL2: "webgl2",
> + WebGPU: "webgpu",
Have we considered different icons for these?
Created attachment 314186[details]
Archive of layout-test-results from ews102 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 314189[details]
Archive of layout-test-results from ews115 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 314350[details]
Archive of layout-test-results from ews103 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 314352[details]
Archive of layout-test-results from ews113 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 314357[details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2
The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Created attachment 314378[details]
Archive of layout-test-results from ews101 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
2017-06-14 22:53 PDT, Devin Rousso
hi: commit-queue-
2017-06-16 10:11 PDT, Devin Rousso
2017-06-20 00:56 PDT, Devin Rousso
2017-06-20 18:33 PDT, Devin Rousso
2017-06-20 20:00 PDT, Build Bot
2017-06-20 20:10 PDT, Build Bot
2017-06-20 22:00 PDT, Devin Rousso
2017-06-20 23:09 PDT, Build Bot
2017-06-20 23:21 PDT, Devin Rousso
2017-06-20 23:59 PDT, Build Bot
2017-06-21 00:43 PDT, Build Bot
2017-06-21 10:32 PDT, Devin Rousso
2017-06-21 11:33 PDT, Build Bot
2017-06-21 11:56 PDT, Build Bot
2017-06-28 19:37 PDT, Devin Rousso
2017-06-28 20:57 PDT, Build Bot
2017-06-29 11:56 PDT, Build Bot
2017-06-29 15:47 PDT, Devin Rousso
joepeck: commit-queue-
2017-06-29 16:50 PDT, Build Bot
2017-06-29 17:09 PDT, Build Bot
2017-06-30 17:19 PDT, Devin Rousso
2017-06-30 19:30 PDT, Build Bot
2017-06-30 19:35 PDT, Build Bot
2017-06-30 20:02 PDT, Build Bot
2017-06-30 21:28 PDT, Devin Rousso
2017-07-01 00:40 PDT, Devin Rousso
2017-07-01 02:27 PDT, Build Bot
2017-07-01 10:45 PDT, Devin Rousso