Closed
Bug 687194
Opened 13 years ago
Closed 10 years ago
Dynamic chrome registration isn't fowarded to content processes
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
FIXED
mozilla34
Tracking | Status | |
---|---|---|
e10s | + | --- |
People
(Reporter: jmaher, Assigned: mrbkap)
References
Details
(Whiteboard: [mobile_unittests] [e10s])
Attachments
(3 files, 2 obsolete files)
(deleted),
patch
|
mossop
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
mossop
:
review+
|
Details | Diff | Splinter Review |
(deleted),
text/x-review-board-request
|
Details |
we try to access chrome://mochitests/content/.../file.js from a test case and load it via loadFrameScript, but we throw an warning in the console indicating we cannot load the specified script. This is most likely due to the fact that we dynamically register tests.jar as chrome://mochitests when we click the 'run tests' button.
Comment 1•13 years ago
|
||
Benjamin said that we should just try to avoid doing that when I last queried him on this issue.
Comment 2•13 years ago
|
||
Avoid doing what, dynamic registration? Its not great but I'm not sure what the alternative is here. Do we not forward dynamic chrome registration stuff? That's going to break a lot of the restartless addons which can now register chrome packages.
Comment 3•13 years ago
|
||
Ah, apparently I wasn't clear last time then. Yeah, no updates take place after the initial chrome dump. That's something that should be fixed.
Comment 4•13 years ago
|
||
This patch might fix the problem here. I need to do some more reading to figure out if there are more possible registrations that could occur that aren't being handled.
Updated•13 years ago
|
Assignee: nobody → josh
Target Milestone: --- → Firefox 9
Version: Trunk → Firefox 10
Updated•11 years ago
|
Product: Fennec Graveyard → Core
Summary: browser chrome tests fail to loadFrameScript from tests.jar → Dynamic chrome registration isn't fowarded to content processes
Whiteboard: [mobile_unittests] → [mobile_unittests] [e10s]
Target Milestone: Firefox 9 → ---
Version: Firefox 10 → Trunk
Comment 5•11 years ago
|
||
This may be important for some addons to work correctly, but I'm not actively working on it.
Assignee: josh → nobody
Blocks: e10s
Comment 6•11 years ago
|
||
Mass tracking-e10s flag change. Filter bugmail on "2be0fcce-e36a-4e2c-aa80-0e3d33eb5406".
tracking-e10s:
--- → +
I think we'll probably go with a more add-on-specific approach for this, using bug 990729.
No longer blocks: e10s
tracking-e10s:
+ → ---
Comment 9•10 years ago
|
||
(In reply to Bill McCloskey (:billm) from comment #7)
> I think we'll probably go with a more add-on-specific approach for this,
> using bug 990729.
Hey Bill, how about mochitest's that rely on content scripts registered by the mochitest harness being available to the content process? I filed bug 1022040 (and then duped it to this bug) regarding that particular use-case.
Is it something we want to support as well?
Updated•10 years ago
|
Flags: needinfo?(wmccloskey)
Updated•10 years ago
|
OS: Linux → All
For my own benefit, the registration happens here:
http://mxr.mozilla.org/mozilla-central/source/testing/mochitest/chrome-harness.js#397
I guess we could take something like Josh's patch, but I'm worried about how this will affect sandboxing. We'll be able to map the file to a path, but we won't actually be able to open it.
However, I guess we could also take Josh's patch. It doesn't make the sandboxing situation any worse, and it would make this a lot easier.
Flags: needinfo?(wmccloskey)
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Comment 11•10 years ago
|
||
I tested this and this seems to make restartless addons work.
Attachment #561911 -
Attachment is obsolete: true
Attachment #8450604 -
Flags: review?(benjamin)
Assignee | ||
Updated•10 years ago
|
Attachment #8450604 -
Flags: review?(benjamin) → review?(dtownsend+bugmail)
Comment 12•10 years ago
|
||
Comment on attachment 8450604 [details] [diff] [review]
jdm's patch
Review of attachment 8450604 [details] [diff] [review]:
-----------------------------------------------------------------
Looks like this will only forward registration of "content" packages. Restartless add-ons can also register "locale", "skin" and "override". This patch could really use some tests.
Attachment #8450604 -
Flags: review?(dtownsend+bugmail) → review-
Assignee | ||
Comment 13•10 years ago
|
||
I think that this is a more complete patch, though I'm at a complete loss as for how to test it. In particular, loading chrome:// in the URL bar loads the resulting page in the chrome process and my attempts to load visible things in the content process only caused tears and assertions.
Mossop said he had an idea of how to test this, I'm hoping he'll comment here to elucidate.
That being said, with this patch, I believe that we'll correctly handle "dynamic" additions and removals of chrome mappings.
Attachment #8450604 -
Attachment is obsolete: true
Attachment #8460554 -
Flags: review?(dtownsend+bugmail)
Comment 14•10 years ago
|
||
So my idea is predicated on being able to load a frame script in tests, but browser-chrome tests should be able to do that?
All the test needs to do is create a directory, put a chrome.manifest in it with some registrations then call "Components.manager.addBootstrappedManifestLocation" for that directory. Then in a frame script attempt to resolve chrome urls that should have been registered with nsIChromeRegistry.convertChromeURL
Comment 15•10 years ago
|
||
Comment on attachment 8460554 [details] [diff] [review]
patch v2
Review of attachment 8460554 [details] [diff] [review]:
-----------------------------------------------------------------
This approach looks good. I'd still like to see tests if we can though
Attachment #8460554 -
Flags: review?(dtownsend+bugmail) → review+
Comment 16•10 years ago
|
||
I had to work around this bug here:
http://hg.mozilla.org/mozilla-central/file/06ac51c2b8a8/dom/tests/browser/browser_test_new_window_from_content.js#l160
So I think a pretty simple test case would be to have some Mochitest support file that is a content script that echoes some message to it. Then load the frame script into some remote browser, send a message to it, and pass if we get the echo back.
Something like that, anyway.
Comment 17•10 years ago
|
||
(In reply to Mike Conley (:mconley) from comment #16)
> I had to work around this bug here:
>
> http://hg.mozilla.org/mozilla-central/file/06ac51c2b8a8/dom/tests/browser/
> browser_test_new_window_from_content.js#l160
>
> So I think a pretty simple test case would be to have some Mochitest support
> file that is a content script that echoes some message to it. Then load the
> frame script into some remote browser, send a message to it, and pass if we
> get the echo back.
>
> Something like that, anyway.
We have this, which might be helpful. I've been thinking of adding mm message support here for a different issue.
http://mxr.mozilla.org/mozilla-central/source/testing/mochitest/mochitest-e10s-utils-content.js
Comment 19•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Comment 20•10 years ago
|
||
To be clear my r+ was predicated on also getting a test written or an explanation of why it isn't possible to test this.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 21•10 years ago
|
||
I'm working on the test now.
Assignee | ||
Comment 22•10 years ago
|
||
For some reason, my extension didn't actually run in the mozbrowser frame, but the test passes. I couldn't make it a chrome test because of exceptions in SpecialPowers setting up the mozbrowser. I also looked at making a browser-chrome test, but was defeated trying to open a remote-process window pointed to a script that I wanted. Ugh.
Attachment #8463562 -
Flags: review?(dtownsend+bugmail)
Assignee | ||
Comment 23•10 years ago
|
||
The extension in attachment 8463562 [details] [diff] [review] can be found at <https://github.com/mrbkap/e10sbug/tree/1f16b390c0165d13bf383e4c2647c1fd149d375e>.
Comment 24•10 years ago
|
||
Comment on attachment 8463562 [details] [diff] [review]
Basic test for chrome registration/unregistration.
Review of attachment 8463562 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good. Should we check the code for the add-on into the tree?
Attachment #8463562 -
Flags: review?(dtownsend+bugmail) → review+
Assignee | ||
Comment 25•10 years ago
|
||
I think it should be enough to check the .xpi into the tree. If somebody wants to modify it, they'll be able to unzip it, make their changes, and repackage it.
Something from here landed in https://hg.mozilla.org/integration/mozilla-inbound/rev/1e2a00dc11cb
And was then backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/fdf012084abd for mochitest-5 failures: https://tbpl.mozilla.org/php/getParsedLog.php?id=45285082&tree=Mozilla-Inbound
Flags: needinfo?(mrbkap)
Assignee | ||
Comment 27•10 years ago
|
||
Pushed again. I had forgotten to disable the new test (ironically) for e10s. Because the test creates its own child process, there's no need to run it explicitly in the child process. Moreover, it uses the AddonManager directly and that can't happen in the child process.
https://hg.mozilla.org/integration/mozilla-inbound/rev/76e8d415df8b
Flags: needinfo?(mrbkap)
Assignee | ||
Comment 28•10 years ago
|
||
The test was failing on Android for some reason. I'm disabling it there. I'll file a followup on investigating why it was failing.
https://hg.mozilla.org/integration/mozilla-inbound/rev/3f8f7939bbd6
Comment 29•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/76e8d415df8b
https://hg.mozilla.org/mozilla-central/rev/3f8f7939bbd6
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Flags: qe-verify-
Comment 30•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/35703/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/35703/
You need to log in
before you can comment on or make changes to this bug.
Description
•