Closed Bug 781379 Opened 12 years ago Closed 12 years ago

getNotInstalled should be under mgmt and return apps from all origins

Categories

(Core Graveyard :: DOM: Apps, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla17

People

(Reporter: anant, Assigned: nick)

References

Details

(Keywords: dev-doc-needed)

Attachments

(1 file, 1 obsolete file)

In bug 768276 the getNotInstalled function was added, but directly under navigator.mozApps. It should be under navigator.mozApps.mgmt, which signifies APIs that are "privileged".

Both getNotInstalled and getAll fall under the privileged category, while getInstalled can stay directly under mozApps since it only returns apps that were installed from the caller's origin.
Summary: getNotInstalled should be under mgmt → getNotInstalled should be under mgmt and return apps from all origins
Keywords: dev-doc-needed
Assignee: nobody → ndesaulniers
Code is functional (I think, but I'll be more confident after unit tests), and I've fixed regressions with the other tests.  Now just to write up a chrome mochitest (not a browser mochitest)!

test with:
TEST_PATH=dom/tests/mochitest/webapps/ make -C objdir/ mochitest-chrome
Depends on: 783391
Tests are green.  Rebasing, and running tests again to double check everything, then submitting patch for review.
Comment on attachment 653436 [details] [diff] [review]
getNotInstalled should be under mgmt and return apps from all origins

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

::: dom/tests/mochitest/webapps/test_getNotInstalled.xul
@@ +17,5 @@
> +
> +let _isLaunchable;
> +let steps = [
> +  cleanUp, installApp, monkeyPatchDOMApplicationRegistry, getNotInstalled,
> +  cleanUp, unmonkeyPatchDOMApplicationRegistry, tearDown

I believe you need to undo the monkey patching before calling cleanUp, otherwise the app you installed won't be uninstalled because the getAll used in uninstallAll will skip it
Attachment #653436 - Attachment is obsolete: true
Attachment #653436 - Flags: review?(felipc)
Attachment #653509 - Flags: review?(felipc)
(In reply to :Felipe Gomes from comment #4)
> Comment on attachment 653436 [details] [diff] [review]
> getNotInstalled should be under mgmt and return apps from all origins
> 
> Review of attachment 653436 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/tests/mochitest/webapps/test_getNotInstalled.xul
> @@ +17,5 @@
> > +
> > +let _isLaunchable;
> > +let steps = [
> > +  cleanUp, installApp, monkeyPatchDOMApplicationRegistry, getNotInstalled,
> > +  cleanUp, unmonkeyPatchDOMApplicationRegistry, tearDown
> 
> I believe you need to undo the monkey patching before calling cleanUp,
> otherwise the app you installed won't be uninstalled because the getAll used
> in uninstallAll will skip it

Good catch, I reordered the steps in the test.
Attachment #653509 - Flags: review?(felipc) → review+
Comment on attachment 653509 [details] [diff] [review]
getNotInstalled should be under mgmt and return apps from all origins

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

Please file a follow-up or backout this patch.

::: dom/interfaces/apps/nsIDOMApplicationRegistry.idl
@@ +54,5 @@
>    /**
> +   * the request will return the applications acquired from all origins but
> +   * which are not launchable (e.g. by not being natively installed), or null.
> +   */
> +  nsIDOMDOMRequest getNotInstalled();

You must change the UUID of the interface.

@@ -95,5 @@
>    /**
> -   * the request will return the applications acquired from this origin but which
> -   * are not launchable (e.g. by not being natively installed), or null.
> -   */
> -  nsIDOMDOMRequest getNotInstalled();

And this one also.
Attachment #653509 - Flags: review+ → review-
Comment on attachment 653509 [details] [diff] [review]
getNotInstalled should be under mgmt and return apps from all origins

Bug 784245 is the follow-up.
Attachment #653509 - Flags: review-
https://hg.mozilla.org/mozilla-central/rev/3e952e6793ae
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
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: