Mochitests for navigator.mozApps

VERIFIED FIXED in mozilla15

Status

()

Core
DOM: Apps
VERIFIED FIXED
5 years ago
5 years ago

People

(Reporter: onecyrenus, Assigned: onecyrenus)

Tracking

(Depends on: 1 bug)

unspecified
mozilla15
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 7 obsolete attachments)

(Assignee)

Description

5 years ago
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.

Updated

5 years ago
OS: Mac OS X → All
Hardware: x86 → All

Updated

5 years ago
Component: Web Apps → DOM: Mozilla Extensions
Product: Firefox → Core
QA Contact: webapps → general

Updated

5 years ago
Whiteboard: [mozappsapi]
(Assignee)

Updated

5 years ago
Whiteboard: [mozappsapi] → [mozApps API 1.0]

Updated

5 years ago
Whiteboard: [mozApps API 1.0] → [mozApps API 1.0] [marketplace-beta?]
(Assignee)

Comment 2

5 years ago
Created attachment 614232 [details]
Patch for mozilla-central
Attachment #614232 - Flags: review?
(Assignee)

Updated

5 years ago
Attachment #614232 - Flags: review? → review?(felipc)
(Assignee)

Comment 3

5 years ago
Created attachment 614261 [details] [diff] [review]
Revision
Attachment #614232 - Attachment is obsolete: true
Attachment #614232 - Flags: review?(felipc)
Attachment #614261 - Flags: review?
(Assignee)

Updated

5 years ago
Attachment #614261 - Flags: review? → review?(felipc)
(Assignee)

Comment 4

5 years ago
https://tbpl.mozilla.org/?tree=Try&pusher=dclarke@mozilla.com
(Assignee)

Comment 5

5 years ago
Created attachment 614495 [details] [diff] [review]
All passing on try server
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+
(Assignee)

Comment 7

5 years ago
Created attachment 615490 [details] [diff] [review]
navigator.mozApps mochitests
Attachment #614495 - Attachment is obsolete: true
Attachment #615490 - Flags: review?
(Assignee)

Comment 8

5 years ago
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 :(
(Assignee)

Comment 9

5 years ago
Created attachment 615498 [details] [diff] [review]
navigator.mozApps mochitests
(Assignee)

Updated

5 years ago
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.

Updated

5 years ago
Blocks: 746465

Updated

5 years ago
Whiteboard: [mozApps API 1.0] [marketplace-beta?] → [marketplace-beta?]

Updated

5 years ago
Whiteboard: [marketplace-beta?]

Updated

5 years ago
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?]
Depends on: 746848
(Assignee)

Comment 12

5 years ago
Created attachment 616819 [details] [diff] [review]
navigator.mozApps mochitests

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)
(Assignee)

Comment 13

5 years ago
Comment on attachment 616819 [details] [diff] [review]
navigator.mozApps mochitests

i'll remove the info('dry_run_set")
(Assignee)

Comment 14

5 years ago
..?
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.
(Assignee)

Comment 18

5 years ago
Created attachment 617664 [details] [diff] [review]
navigator.mozApps mochitests
Attachment #617664 - Flags: review?
(Assignee)

Updated

5 years ago
Attachment #617664 - Attachment is obsolete: true
Attachment #617664 - Flags: review?
(Assignee)

Updated

5 years ago
Attachment #616819 - Flags: review?(jst) → review?(felipc)
(Assignee)

Updated

5 years ago
Attachment #617664 - Attachment is obsolete: false
Attachment #617664 - Flags: review?(felipc)
(Assignee)

Updated

5 years ago
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!
(Assignee)

Comment 20

5 years ago
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dclarke@mozilla.com-0a5368647a84/try-win32-debug/try_win7-debug_test-mochitest-other-bm23-tests1-windows-build1140.txt.gz

Tryserver results
(Assignee)

Comment 21

5 years ago
Created attachment 618175 [details] [diff] [review]
navigator.mozApps mochitests
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+
(Assignee)

Comment 23

5 years ago
awesome
Attachment #615498 - Flags: review?(felipc)
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
Last Resolved: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
(Assignee)

Updated

5 years ago
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
https://hg.mozilla.org/mozilla-central/rev/e7bf8b1386e3
Depends on: 754223
Depends on: 754578

Updated

5 years ago
Component: DOM: Mozilla Extensions → DOM: Apps
You need to log in before you can comment on or make changes to this bug.