Closed
Bug 1414460
Opened 7 years ago
Closed 7 years ago
Add unit test for getAllFlexbox method of the LayoutActor
Categories
(DevTools :: Inspector, enhancement, P3)
DevTools
Inspector
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: gl, Assigned: gl)
Details
Attachments
(1 file)
59 bytes,
text/x-review-board-request
|
Details |
No description provided.
Assignee | ||
Updated•7 years ago
|
Priority: -- → P3
Comment hidden (mozreview-request) |
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8926914 [details]
Bug 1414460 - Add unit test for getAllFlexbox method of the LayoutActor.
https://reviewboard.mozilla.org/r/198144/#review203702
Looks good, thanks. I think we miss a few test cases, and then we should be good.
::: devtools/server/tests/browser/browser_layout_getAllFlexbox.js:15
(Diff revision 1)
> + let { client, walker, layout } = yield initLayoutFrontForUrl(MAIN_DOMAIN +
> + "flexbox.html");
> + let flexboxes = yield layout.getAllFlexbox(walker.rootNode, true);
> + let flexbox = flexboxes[0];
> +
> + is(flexboxes.length, 1, "One flexbox was returned.");
This is a simple test, it's good, but ideally we would test every possible way for the method to run: 0 containers, 1 container, many containers, missing rootNode, traverseFrame true and false, etc.
::: devtools/server/tests/browser/browser_layout_getAllFlexbox.js:17
(Diff revision 1)
> + let flexboxes = yield layout.getAllFlexbox(walker.rootNode, true);
> + let flexbox = flexboxes[0];
> +
> + is(flexboxes.length, 1, "One flexbox was returned.");
> +
> + info("Get the grid container node front.");
s/grid/flex
::: devtools/server/tests/browser/browser_layout_simple.js:7
(Diff revision 1)
> /* Any copyright is dedicated to the Public Domain.
> http://creativecommons.org/publicdomain/zero/1.0/ */
>
> "use strict";
>
> -// Simple checks for the LayoutActor and GridActor
> +// Simple checks for the LayoutActor and GridActor.
And FlexBoxActor I guess.
::: devtools/server/tests/browser/browser_layout_simple.js:19
(Diff revision 1)
> + ok(layout.getAllFlexbox, "The getAllFlexbox method exists");
> ok(layout.getAllGrids, "The getAllGrids method exists");
>
> let didThrow = false;
> try {
> - yield layout.getGrids(null);
> + yield layout.getAllFlexbox(null);
Why don't we do this anymore for grid? We should not remove this test case, but add one for flexbox instead.
Attachment #8926914 -
Flags: review?(pbrosset)
Assignee | ||
Comment 3•7 years ago
|
||
(In reply to Patrick Brosset <:pbro> from comment #2)
> ::: devtools/server/tests/browser/browser_layout_simple.js:19
> (Diff revision 1)
> > + ok(layout.getAllFlexbox, "The getAllFlexbox method exists");
> > ok(layout.getAllGrids, "The getAllGrids method exists");
> >
> > let didThrow = false;
> > try {
> > - yield layout.getGrids(null);
> > + yield layout.getAllFlexbox(null);
>
> Why don't we do this anymore for grid? We should not remove this test case,
> but add one for flexbox instead.
getGrids is actually not a public method hence why it was removed.
Comment 4•7 years ago
|
||
(In reply to Gabriel [:gl] (ΦωΦ) from comment #3)
> getGrids is actually not a public method hence why it was removed.
Ok. So I guess getAllGrids should be tested then, just like you test getAllFlexbox here. I don't think we test the getAllGrids(null) case now.
Assignee | ||
Comment 5•7 years ago
|
||
We never went about adding a getAllFlexbox method so closing this.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•