b2g mochitest app doesn't attach the SpecialPowers object to popup windows

RESOLVED FIXED in mozilla27

Status

defect
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: martijn.martijn, Assigned: martijn.martijn)

Tracking

unspecified
mozilla27
x86
macOS
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

()

Attachments

(1 attachment, 2 obsolete attachments)

Popup windows don't have SpecialPowers attached in b2g mochitest, I just hit this problem again in bug 918604, comment 5.
Posted patch 918842.diff (obsolete) — Splinter Review
Attachment #809099 - Flags: review?(jmaher)
Comment on attachment 809099 [details] [diff] [review]
918842.diff

Review of attachment 809099 [details] [diff] [review]:
-----------------------------------------------------------------

::: testing/mochitest/b2g_start_script.js
@@ +24,5 @@
> +  if (aEvent.detail.features.indexOf('height') != -1) {
> +    let height = aEvent.detail.features.substr(aEvent.detail.features.indexOf('height')+7);
> +    height = height.substr(0, height.indexOf(',') == -1 ? height.length : height.indexOf(','));
> +    popupIframe.style.height = height + 'px';
> +  }

this doesn't seem related to special powers.  Is there a reason for having this in here?
Attachment #809099 - Flags: review?(jmaher) → review+
Yes, sorry, I should have explained. This is to resize the iframe to the width/height of what the window.open call asks for.
This is why test_bug199692.html is failing, a 600*600 popup is being requested to open, so with the attached patch, that test is passing, but without it, it is failing.
please add a comment to reference that.  I wasn't aware that creating a popup with specified width/height would not be at that.  Either it is a bug or something not supported.
Blocks: 918604
Posted patch 918842.diff (obsolete) — Splinter Review
Ok, comment added.

Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=4d43dfa2164d
Attachment #809099 - Attachment is obsolete: true
Tryserver shows that dom/tests/mochitest/dom-level0/test_innerWidthHeight_script.html is still failing (converting that in bug 918604 to use SpecialPowers).
So apparently, this patch is not working. Not sure why it helps bug326337, though.
This might be the reason:
http://mxr.mozilla.org/mozilla-central/source/testing/specialpowers/content/specialpowers.js?force=1#125
The popupIframe already exists, so the DOMWindowCreated event is not run.
Adding this line makes it work:
    mm.loadFrameScript('data:,attachSpecialPowersToWindow%28content%29%3B', true);

With that line, I get still get failures in test_innerWidthHeight_script.html. Adding this line to that test file, makes it work:
    SpecialPowers.pushPrefEnv({"set": [["dom.disable_window_move_resize", false]]}, runTest);
That makes sense, because that file originally had enablePrivilege in it. Anyway, this belongs in an updated patch for bug 918604.
Attachment #809163 - Attachment is obsolete: true
Comment on attachment 810004 [details] [diff] [review]
918842.diff (for check-in)

Review of attachment 810004 [details] [diff] [review]:
-----------------------------------------------------------------

Try server is green now.
Attachment #810004 - Flags: review?(jmaher)
Comment on attachment 810004 [details] [diff] [review]
918842.diff (for check-in)

Review of attachment 810004 [details] [diff] [review]:
-----------------------------------------------------------------

thanks
Attachment #810004 - Flags: review?(jmaher) → review+
Keywords: checkin-needed
Attachment #810004 - Attachment description: 918842.diff → 918842.diff (for check-in)
https://hg.mozilla.org/mozilla-central/rev/70ec111942ca
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Keywords: checkin-needed
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.