Closed Bug 1427818 Opened 2 years ago Closed 2 years ago

Fix browser_layoutHelpers-getBoxQuads.js on e10s

Categories

(DevTools :: General, defect, P3)

defect

Tracking

(firefox59 fixed)

RESOLVED FIXED
Firefox 59
Tracking Status
firefox59 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

Attachments

(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
    returnsTheRightDataStructure@chrome://mochitests/content/browser/devtools/client/shared/test/browser_layoutHelpers-getBoxQuads.js:38:15
Assignee: nobody → poirot.alex
Priority: -- → P3
Comment on attachment 8939755 [details]
Bug 1427818 - Fix browser_layoutHelpers-getBoxQuads.js on e10s.

https://reviewboard.mozilla.org/r/210060/#review215750

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 apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a66b031b9f6b
Fix browser_layoutHelpers-getBoxQuads.js on e10s. r=pbro
https://hg.mozilla.org/mozilla-central/rev/a66b031b9f6b
Status: NEW → RESOLVED
Closed: 2 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.