Closed Bug 741549 Opened 12 years ago Closed 12 years ago

Mochitests for navigator.mozApps

Categories

(Core Graveyard :: DOM: Apps, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla15

People

(Reporter: onecyrenus, Assigned: onecyrenus)

References

Details

Attachments

(1 file, 7 obsolete files)

Developed a set of mochitests for navigator.mozApps

Currently there are two tests that are not working. 

#1) UTF-8 test.  There is an outstanding bug for this 
https://bugzilla.mozilla.org/show_bug.cgi?id=738298

#2) No content-type checking 
https://bugzilla.mozilla.org/show_bug.cgi?id=741526
https://bugzilla.mozilla.org/show_bug.cgi?id=712045
This bug isn't applicable to the web apps integration into desktop feature. This bug I believe belongs in Core/DOM --> Mozilla Extensions. Myk could confirm this.
OS: Mac OS X → All
Hardware: x86 → All
Component: Web Apps → DOM: Mozilla Extensions
Product: Firefox → Core
QA Contact: webapps → general
Whiteboard: [mozappsapi]
Whiteboard: [mozappsapi] → [mozApps API 1.0]
Whiteboard: [mozApps API 1.0] → [mozApps API 1.0] [marketplace-beta?]
Attached file Patch for mozilla-central (obsolete) —
Attachment #614232 - Flags: review?
Attachment #614232 - Flags: review? → review?(felipc)
Attached patch Revision (obsolete) — Splinter Review
Attachment #614232 - Attachment is obsolete: true
Attachment #614232 - Flags: review?(felipc)
Attachment #614261 - Flags: review?
Attachment #614261 - Flags: review? → review?(felipc)
Attached patch All passing on try server (obsolete) — Splinter Review
Attachment #614261 - Attachment is obsolete: true
Attachment #614261 - Flags: review?(felipc)
Attachment #614495 - Flags: review?(felipc)
Comment on attachment 614495 [details] [diff] [review]
All passing on try server

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

This is looking good, thanks for all these tests. No major changes necessary, just some hopefully straightforward ones.

Some notes:
- files with a license header should use MPL2 http://www.mozilla.org/MPL/headers/ (or public domain which is also accepted for test files, if you prefer)

- needs to clear out all debugging code (info("..") calls for example)

- biggest change necessary is to drop urlmatch.js and just use nsIURI. It's simple: where you have the `url` as a string, you just call:
  var uri = Services.io.newURI(url, null, null);

  Then you can use all of these properties: http://mxr.mozilla.org/mozilla-central/source/netwerk/base/public/nsIURI.idl#105

- all the functions in dom/tests/mochitest/webapps/apps/jshelper.js seems to be unused? If that was only for debugging can you remove that file and the places where it was included?
  And most of the ones in the other jshelper.js too. If there's only a few you could just move them all to apphelper.js and have a single file to include. If that complicates things though don't bother, just remove whatever is unused

- you can begin strings with quotes with ' to avoid having to escape the double quotes

- where does jschannel.js comes from? and is it used? i can't find any references

::: dom/tests/mochitest/webapps/Makefile.in
@@ +50,5 @@
> +include $(topsrcdir)/config/rules.mk
> +
> +_TEST_FILES	= \
> +		test_install_app.xul \
> +    test_list_api.xul \

inconsistent indentation in this block, please make it all match

::: dom/tests/mochitest/webapps/README
@@ +1,1 @@
> +This repo represents a WIP graft onto the Firefox mochitest tree of mozilla-central.

This file can be removed

::: dom/tests/mochitest/webapps/jshelper.js
@@ +105,5 @@
> +  }
> +  info(output);
> +}
> +
> +function js_traverse(template, check, object) {

explain what js_traverse does

@@ +150,5 @@
> +    check(eval(evaluate), "#" + object + "# is expected to be true per template #" + template + "#");
> +  }
> +}
> +
> +function mozAppscb(pending, comparatorObj, check, next) {

> function mozAppscb(pending, comparatorObj, check, next) {

can you rename this function to something more clear and write a brief comment on what's the purpose of this function?
Attachment #614495 - Flags: review?(felipc) → feedback+
Attached patch navigator.mozApps mochitests (obsolete) — Splinter Review
Attachment #614495 - Attachment is obsolete: true
Attachment #615490 - Flags: review?
With this patch, covered everything except renaming mozAppscb, which I documented instead. 


dom/tests/mochitest/webapps/jshelper.js  < -- this file is the required file
dom/tests/mochitest/webapps/apps/jshelper.js <-- this file is not required
Removed apps/test.html
Removed urlmatch.js
Removed README

info messages are now only shown if DEBUG = 1
removed references to jschannel it was used awhile ago.. 
I didn't change all the quotes, but will keep that in mind for next tests 

apphelper / jshelper, cannot be merged, because apphelper only works in the chrome context, whereas jshelper can be loaded by the iframe, loading chrome context inside an iframe won't work :(
Attached patch navigator.mozApps mochitests (obsolete) — Splinter Review
Attachment #615498 - Attachment is obsolete: true
Attachment #615498 - Attachment is patch: true
Attachment #615498 - Flags: review?(felipc)
We should try to land this before the FF 14 merge.
Blocks: 746465
Whiteboard: [mozApps API 1.0] [marketplace-beta?] → [marketplace-beta?]
Whiteboard: [marketplace-beta?]
Whiteboard: [marketplace-beta?]
what happens if this doesn't land? This effort is important, but do the basic flows break if it's not implemented? I say no so not a blocker. Someone can correct me though.
Whiteboard: [marketplace-beta?]
Attached patch navigator.mozApps mochitests (obsolete) — Splinter Review
Latest tests updated to work with the dry run variable.
Attachment #615490 - Attachment is obsolete: true
Attachment #615490 - Flags: review?
Attachment #616819 - Flags: review?(felipc)
Comment on attachment 616819 [details] [diff] [review]
navigator.mozApps mochitests

i'll remove the info('dry_run_set")
..?
Is there someone else available to review David's patch? I know Felipe is busy with the firefox work week and a lot of the desktop bug fixes.
Attachment #616819 - Attachment is patch: true
Comment on attachment 616819 [details] [diff] [review]
navigator.mozApps mochitests

Almost all of the changes are in dom/tests/, which is actually part of the Document Object Model module <https://wiki.mozilla.org/Modules/All#Document_Object_Model>, so subject to review by the DOM module owner or a peer.

Johnny: can you review this or identify an appropriate reviewer?
Attachment #616819 - Flags: review?(felipc) → review?(jst)
Sorry for not updating the status of this bug. I reviewed these tests and they look fine. I sent them to tryserver last night though but some of the tests failed:
https://tbpl.mozilla.org/?tree=Try&rev=a437d8b5036a

dclarke, any idea what happened?

I can still review it if someone from the DOM module thinks that is fine. It's all tests.
Attached patch navigator.mozApps mochitests (obsolete) — Splinter Review
Attachment #617664 - Flags: review?
Attachment #617664 - Attachment is obsolete: true
Attachment #617664 - Flags: review?
Attachment #616819 - Flags: review?(jst) → review?(felipc)
Attachment #617664 - Attachment is obsolete: false
Attachment #617664 - Flags: review?(felipc)
Attachment #616819 - Attachment is obsolete: true
Attachment #616819 - Flags: review?(felipc)
I have no problems with Felipe doing the review of these tests in the DOM code!
Attachment #617664 - Attachment is obsolete: true
Attachment #617664 - Flags: review?(felipc)
Comment on attachment 618175 [details] [diff] [review]
navigator.mozApps mochitests

Thanks Dave! I'll land this soon
Attachment #618175 - Flags: review+
awesome
https://hg.mozilla.org/integration/mozilla-inbound/rev/f0b9f5c391a8
Assignee: nobody → dclarke
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/f0b9f5c391a8
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
I removed the call to enablePrivilege("UniversalXPConnect") on a follow-up as it was unnecessary.

https://hg.mozilla.org/integration/mozilla-inbound/rev/e7bf8b1386e3
Depends on: 754223
Depends on: 754578
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: