Closed Bug 770832 Opened 12 years ago Closed 12 years ago

Add 'localeId' to WebApps registry

Categories

(Core Graveyard :: DOM: Apps, defect)

defect
Not set
normal

Tracking

(blocking-basecamp:+)

RESOLVED FIXED
mozilla16
blocking-basecamp +

People

(Reporter: mounir, Assigned: mounir)

References

Details

(Whiteboard: [qa-])

Attachments

(2 files)

Attached patch PatchSplinter Review
This is needed so we have a simple and short ID for apps. UUID should only be used to identify app for sync purpose.
Attachment #639033 - Flags: review?(fabrice)
Comment on attachment 639033 [details] [diff] [review]
Patch

Renaming - autocomplete has been quite smart...
Attachment #639033 - Attachment description: Patch v1 - Fix the bug for html content → Patch
Blocks: 770831
Comment on attachment 639033 [details] [diff] [review]
Patch

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

What you have there is fine, except that if we already have webapps installed without a localId they won't get one.
Can you check at http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/Webapps.jsm#62 that apps have localIds and add them if they are missing?

r=me with that.

::: dom/apps/src/AppsService.js
@@ +39,5 @@
>    classInfo : XPCOMUtils.generateCI({classID: APPS_SERVICE_CID,
>                                       contractID: APPS_SERVICE_CONTRACTID,
>                                       classDescription: "AppsService",
>                                       interfaces: [Ci.nsIAppsService],
>                                       flags: Ci.nsIClassInfo.DOM_OBJECT})

You don't need all this classInfo stuff.
Attachment #639033 - Flags: review?(fabrice) → review+
Fabrice, is that what you were expecting?

Also, I didn't get your comment about the classinfo stuff. I haven't touched that.
Attachment #639714 - Flags: review?(fabrice)
Also, the Gaia pull request is ready:
https://github.com/mozilla-b2g/gaia/pull/2233
Attachment #639714 - Flags: review?(fabrice) → review+
(In reply to Mounir Lamouri (:mounir) from comment #3)

> Also, I didn't get your comment about the classinfo stuff. I haven't touched
> that.

This is because you ignored https://bugzilla.mozilla.org/show_bug.cgi?id=754141#c5 in the first place ;)
(In reply to Fabrice Desré [:fabrice] from comment #5)
> (In reply to Mounir Lamouri (:mounir) from comment #3)
> 
> > Also, I didn't get your comment about the classinfo stuff. I haven't touched
> > that.
> 
> This is because you ignored
> https://bugzilla.mozilla.org/show_bug.cgi?id=754141#c5 in the first place ;)

Bug 772050.
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/104a6456639e
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Is this possible to verify at the JS API level?
Whiteboard: [qa?]
You can use AppsService to get the localId of an installed app. However, you need to be a privileged content to access this service.

Note that we should be able to simple automatic tests for this when bug 770894 will be done.
(In reply to Mounir Lamouri (:mounir) from comment #9)
> You can use AppsService to get the localId of an installed app. However, you
> need to be a privileged content to access this service.
> 
> Note that we should be able to simple automatic tests for this when bug
> 770894 will be done.

See my comment in bug 770894. There's already a capability to write automated tests for the mozapps API on m-c.
Whiteboard: [qa?] → [qa+]
(In reply to Mounir Lamouri (:mounir) from comment #9)
> You can use AppsService to get the localId of an installed app. However, you
> need to be a privileged content to access this service.

What do you mean by privileged content?

On my localhost, I just installed an app and did the following below, but I got "undefined" when I accessed localId:

var request = window.navigator.mozApps.getSelf();  
request.onsuccess = function() {  
        // Pull the name of the app out of the App object  
	alert("App Result Test: " + request.result.localId);  
};  
request.onerror = function() {  
	// Display error name from the DOMError object  
	alert("Error: " + request.error.name);  
};
(In reply to Jason Smith [:jsmith] from comment #11)
> (In reply to Mounir Lamouri (:mounir) from comment #9)
> > You can use AppsService to get the localId of an installed app. However, you
> > need to be a privileged content to access this service.
> 
> What do you mean by privileged content?
> 
> On my localhost, I just installed an app and did the following below, but I
> got "undefined" when I accessed localId:
> 
> var request = window.navigator.mozApps.getSelf();  
> request.onsuccess = function() {   
> 	alert("App Result Test: " + request.result.localId);  
> };  
> request.onerror = function() {  
> 	// Display error name from the DOMError object  
> 	alert("Error: " + request.error.name);  
> };

Slight fix on the above code: Ignore the comment above the first alert (bad copy and paste on my part).
Whiteboard: [qa+] → [qa?]
(In reply to Jason Smith [:jsmith] from comment #11)
> (In reply to Mounir Lamouri (:mounir) from comment #9)
> > You can use AppsService to get the localId of an installed app. However, you
> > need to be a privileged content to access this service.
> 
> What do you mean by privileged content?

This is "chrome" privileged code. This property is not exposed to web content, so there's no way to test anything from an html page.
Whiteboard: [qa?] → [qa-]
blocking-basecamp: ? → +
Component: DOM: Mozilla Extensions → DOM: Apps
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: