haikuwebkit/LayoutTests/inspector/dom/showGridOverlay-expected.txt

64 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

Web Inspector: implement the basics for showing/hiding grid overlays https://bugs.webkit.org/show_bug.cgi?id=221062 Reviewed by Devin Rousso. Source/JavaScriptCore: Add new commands to show and hide CSS grid overlays: - DOM.showGridOverlay - DOM.hideGridOverlay * inspector/protocol/DOM.json: Source/WebCore: Implement backend commands for showing and hiding CSS grid overlays. This patch draws a very simplistic grid overlay. Support for the various grid overlay options will be added in later patches. New test: inspector/dom/showGridOverlay.html * inspector/InspectorOverlay.h: (WebCore::InspectorOverlay::gridOverlayCount const): Added, for testing only. * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::paint): (WebCore::InspectorOverlay::shouldShowOverlay const): Hook up the painting of any active grid overlays. (WebCore::InspectorOverlay::setGridOverlayForNode): (WebCore::InspectorOverlay::clearGridOverlayForNode): (WebCore::InspectorOverlay::clearAllGridOverlays): Maintain the list of active grid overlays. A node can only have one grid overlay at a time. (WebCore::InspectorOverlay::drawNodeHighlight): Add a note about why grid overlays are not considered when calculating the ruler exclusion area. (WebCore::InspectorOverlay::drawGridOverlay): Added. This drawing code exists to flesh out the rest of this patch, and is obviously incomplete. Draw grid lines that extend to the edge of the viewport, equivalent to `config.showExtendedGridLines = true`. * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::showGridOverlay): (WebCore::InspectorDOMAgent::hideGridOverlay): Translate protocol commands into InspectorOverlay method calls. * inspector/InspectorController.h: * inspector/InspectorController.cpp: (WebCore::InspectorController::gridOverlayCount const): Added. This is used for testing purposes only. * testing/Internals.h: * testing/Internals.idl: * testing/Internals.cpp: (WebCore::Internals::inspectorGridOverlayCount): Added. Source/WebInspectorUI: Expose new DOM.showGridOverlay and DOM.hideGridOverlay commands via WI.DOMNode. Add initial engineering UI to toggle grid overlays. New methods are covered by a new test: inspector/dom/showGridOverlay.html Additions to WI.DOMManager.prototype.requestDocument are covered by existing tests (callback case) and a new test (promise case). Additions to WI.Color are covered by a new test case in: inspector/model/color.html * UserInterface/Controllers/DOMManager.js: (WI.DOMManager.prototype.requestDocument): (WI.DOMManager.prototype._requestDocumentWithPromise): Drive-by: upgrade requestDocument() to return a promise if no callback argument was passed. This is used by a new test. * UserInterface/Models/Color.js: (WI.Color.prototype.toProtocol): Added. The protocol object is DOM.RGBAColor, which is the same thing as WI.Color.Format.RGBA. * UserInterface/Models/DOMNode.js: (WI.DOMNode.prototype.showGridOverlay): (WI.DOMNode.prototype.hideGridOverlay): Added. These are the methods that the rest of WebInspectorUI uses to interact with grid overlays for a particular node. Note that these methods return either an unsettled promise (from the agent call) or a rejected promise (in the case that the node is destroyed). This allows test cases to `await` before checking the grid overlay count. * UserInterface/Test/TestHarness.js: (TestHarness.prototype.expectException): Improve logging output when InspectorTest.expectException does not catch an exception. * UserInterface/Views/ContextMenuUtilities.js: Add some engineering-only context menu items for showing/hiding grid overlays to DOMTreeElements in the Elements Tab. These are in place for development purposes and should eventually be removed when no longer needed. LayoutTests: * inspector/dom/showGridOverlay-expected.txt: Added. * inspector/dom/showGridOverlay.html: Added. This test does not cover the actual drawing code. The drawing method will change a lot and is not easy to test currently. The new test covers the behavior of showGridOverlay/hideGridOverlay by querying how many grid overlays are active according to InspectorOverlay. * inspector/model/color-expected.txt: * inspector/model/color.html: Add a test case to exercise WI.Color.prototype.toProtocol(). * inspector/unit-tests/test-harness-expect-functions-async-expected.txt: Rebaseline results after adding more state dumping in the failure case for InspectorTest.expectException(). Canonical link: https://commits.webkit.org/233573@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-02 09:02:31 +00:00
Tests for the DOM.showGridOverlay command.
A
B
C
D
E
F
A
B
C
D
E
F
== Running test suite: DOM.showGridOverlay
-- Running test case: DOM.showGridOverlay.ShowOneGrid
PASS: Should have 0 grids displayed.
Requesting to show grid overlay for first .grid-container
PASS: Should have 1 grid displayed.
Requesting to show a different grid overlay for first .grid-container
PASS: Should have 1 grid displayed.
Requesting to hide grid overlay
PASS: Should have 0 grids displayed.
-- Running test case: DOM.showGridOverlay.ShowTwoGrids
PASS: Should have 0 grids displayed.
Requesting to show first grid overlay
PASS: Should have 1 grid displayed.
Requesting to show second grid overlay
PASS: Should have 2 grids displayed.
Requesting to hide first grid overlay
PASS: Should have 1 grid displayed.
Requesting to hide second grid overlay
PASS: Should have 0 grids displayed.
-- Running test case: DOM.showGridOverlay.HideAllGrids
PASS: Should have 0 grids displayed.
Requesting to show grid overlay
PASS: Should have 1 grid displayed.
Requesting to show a different grid overlay
PASS: Should have 2 grids displayed.
Requesting to hide all grid overlays. Hiding all grids is idempotent and should not throw an error.
PASS: Should have 0 grids displayed.
Requesting to hide all grid overlays again, expecting none to be cleared. Hiding all grids is idempotent and should not throw an error.
PASS: Should have 0 grids displayed.
-- Running test case: DOM.showGridOverlay.HideBeforeShowShouldError
PASS: Should have 0 grids displayed.
Requesting to hide grid overlay for .grid-container
PASS: Should produce an exception.
Error: No grid overlay exists for the node, so cannot clear.
Requesting to hide all grid overlays. Hiding all grids is idempotent and should not throw an error.
PASS: Should have 0 grids displayed.
-- Running test case: DOM.showGridOverlay.ForNonexistentNodeShouldError
PASS: Should have 0 grids displayed.
Requesting to show grid overlay for invalid nodeId -1
PASS: Should produce an exception.
Error: Missing node for given nodeId
PASS: Should have 0 grids displayed.