Closed Bug 1427818 Opened 3 years ago Closed 3 years ago

Fix browser_layoutHelpers-getBoxQuads.js on e10s


(DevTools :: General, defect, P3)



(firefox59 fixed)

Firefox 59
Tracking Status
firefox59 --- fixed


(Reporter: ochameau, Assigned: ochameau)


(Blocks 1 open bug)



(1 file)

browser_layoutHelpers-getBoxQuads.js currently fails with:
TEST-UNEXPECTED-FAIL | devtools/client/shared/test/browser_layoutHelpers-getBoxQuads.js | Uncaught exception - at resource://devtools/shared/base-loader.js -> resource://devtools/shared/layout/utils.js:198 - Error: unsafe CPOW usage forbidden
Stack trace:
    getAdjustedQuads@resource://devtools/shared/base-loader.js -> resource://devtools/shared/layout/utils.js:198:16
Assignee: nobody → poirot.alex
Priority: -- → P3
Comment on attachment 8939755 [details]
Bug 1427818 - Fix browser_layoutHelpers-getBoxQuads.js on e10s.

I agree with the approach (which is the same you've used in other tests I already reviewed).
I would just like to move and comment some code so that the communication mechanism used in this test is easy to understand.

::: devtools/client/shared/test/browser_layoutHelpers-getBoxQuads.js:16
(Diff revision 1)
> -
> -  ok(typeof getAdjustedQuads === "function", "getAdjustedQuads is defined");
>    info("Running tests");
> -  returnsTheRightDataStructure(doc);
> +  let mm = tab.linkedBrowser.messageManager;

Please add a comment line before this block of code explaining why this command thing is even needed.
If I understand correctly, window.FullZoom isn't available from the ContentTask, right? Which is why you need to run it in this process instead, and therefore expose it via the MM.
If that's correct, then the comment should say this.

::: devtools/client/shared/test/browser_layoutHelpers-getBoxQuads.js:211
(Diff revision 1)
> -  ok(zoomedInQuad.bounds.width > defaultQuad.bounds.width,
> +      ok(zoomedInQuad.bounds.width > defaultQuad.bounds.width,
> -    "The zoomed in quad is bigger than the default one");
> +        "The zoomed in quad is bigger than the default one");
> -  ok(zoomedInQuad.bounds.height > defaultQuad.bounds.height,
> +      ok(zoomedInQuad.bounds.height > defaultQuad.bounds.height,
> -    "The zoomed in quad is bigger than the default one");
> +        "The zoomed in quad is bigger than the default one");
> +      function sendCommand(cmd) {

This function seems a bit misplaced. It is used before and after this location. 
Can you please move it all the way up, as the first part of the ContentTask script?
This way it will be close to the MM listener just before.
Attachment #8939755 - Flags: review?(pbrosset) → review+
Pushed by
Fix browser_layoutHelpers-getBoxQuads.js on e10s. r=pbro
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 59
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.