Closed Bug 1259094 Opened 8 years ago Closed 8 years ago

Registering chrome gaia content should not be hardcoded

Categories

(Firefox OS Graveyard :: Runtime, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gerard-majax, Assigned: gerard-majax)

References

Details

(Whiteboard: fixed-in-pine)

Attachments

(1 file, 6 obsolete files)

Right now we need to change b2g/components/B2GComponents.manifest to change where Gaia content chrome URLs points to.
On eng builds, apps are located in /data/local/apps. I have to symlink /system/b2g/apps there to load Gaia.
This is WIP but it works for me on Mulet and device. On mulet, picks "apps"
within the selected profile directory. On device, only picks from
/system/b2g/apps (for now).
That might help you getting tests running with Mulet, if you want to try this on try :)
Flags: needinfo?(aus)
Oh yes, this TOTALLY works! Thank you so much for figuring this out!

https://treeherder.mozilla.org/#/jobs?repo=try&revision=8104c4a15b32&filter-tier=1&filter-tier=2&filter-tier=3&selectedJob=18569897

We are obviously now seeing the real test failures, which is EXACTLY what we want! \o/!!!
Flags: needinfo?(aus)
Blocks: 1259238
MozReview-Commit-ID: KbOjcgzqs1C
Attachment #8734766 - Flags: feedback?(fabrice)
Fabrice, do you think it is too much hacky or we can move on with this?
Attachment #8734498 - Attachment is obsolete: true
Fixing build on GCC 4.9
Attachment #8734766 - Attachment is obsolete: true
Attachment #8734766 - Flags: feedback?(fabrice)
Attachment #8734783 - Flags: feedback?(fabrice)
Comment on attachment 8734783 [details] [diff] [review]
Remove harcoded path to Gaia chrome package

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

Hm, no way to do that from an app-startup observer with all the code under b2g/ ?
Attachment #8734783 - Flags: feedback?(fabrice)
(In reply to [:fabrice] Fabrice Desré from comment #8)
> Comment on attachment 8734783 [details] [diff] [review]
> Remove harcoded path to Gaia chrome package
> 
> Review of attachment 8734783 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Hm, no way to do that from an app-startup observer with all the code under
> b2g/ ?

As far as I can tell, I have not been able to find any interface usable from JS. So we need some C++ executed on both Mulet and B2G, and this was the best I could find. I don't think |b2g/app/nsBrowserApp.cpp| is being used.
(In reply to [:fabrice] Fabrice Desré from comment #8)
> Comment on attachment 8734783 [details] [diff] [review]
> Remove harcoded path to Gaia chrome package
> 
> Review of attachment 8734783 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Hm, no way to do that from an app-startup observer with all the code under
> b2g/ ?

I have a preliminary (hacked) XPCOM written in C++ and triggered by "profile-after-change" that is able to register a chrome gaia package. So I can rewrite this in a nicer way and avoid hacking around toolkit/xre/nsAppRunner.cpp.
WIP with start of XPCOM C++
Attachment #8734783 - Attachment is obsolete: true
Attachment #8735129 - Attachment is obsolete: true
MozReview-Commit-ID: D52LOzYMDkF
Attachment #8735150 - Attachment is obsolete: true
Attachment #8735152 - Flags: review?(fabrice)
Comment on attachment 8735152 [details] [diff] [review]
Remove harcoded path to Gaia chrome package r?fabrice

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

r=me with comments addressed.

::: b2g/components/moz.build
@@ +90,5 @@
> +
> +XPIDL_MODULE = 'gaia_chrome'
> +
> +UNIFIED_SOURCES += [
> +    'nsGaiaChrome.cpp'

nit: no need for a `ns` prefix.

::: b2g/components/nsGaiaChrome.cpp
@@ +66,5 @@
> +  locationDetection->Append(mAppsDir);
> +  nsresult appsInSystem = EnsureIsDirectory(locationDetection);
> +  locationDetection->InitWithPath(mDataRoot);
> +  locationDetection->Append(mAppsDir);
> +  nsresult appsInData   = EnsureIsDirectory(locationDetection);

nit: too many spaces after appsInData

@@ +89,5 @@
> +  return NS_OK;
> +}
> +
> +nsresult
> +nsGaiaChrome::EnsureIsDirectory(nsIFile* aPath)

I don't see any reason to not return a boolean.
Attachment #8735152 - Flags: review?(fabrice) → review+
MozReview-Commit-ID: D52LOzYMDkF
Attachment #8735152 - Attachment is obsolete: true
Attachment #8735492 - Flags: review+
https://hg.mozilla.org/projects/pine/rev/ccddb6dcc121
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: fixed-in-pine
Depends on: 1260873
Blocks: 1287107
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: