Closed
Bug 912184
Opened 12 years ago
Closed 12 years ago
gallery unit tests use requireApp() to load shared/js modules
Categories
(Firefox OS Graveyard :: Gaia::Gallery, defect)
Firefox OS Graveyard
Gaia::Gallery
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bkelly, Assigned: bkelly)
Details
(Whiteboard: [ c= p=2 s=2013.09.06 ])
Attachments
(1 file)
Currently gallery/test/unit/setup.js uses requireApp() to load a couple resources from shared/js. For example:
https://github.com/mozilla-b2g/gaia/blob/master/apps/gallery/test/unit/setup.js#L17
This causes the browser to attempt to load from the shared.gaiamobile.org domain. For most people this fails immediately since the domain is bogus.
For unlucky folks like me, however, our ISP helpfully provides valid IP addresses for invalid domains. Not only that, but in my case it allows me to connect to the IP, but never returns a resource. For example:
telnet shared.gaiamobile.org 80
Trying 92.242.140.2...
Connected to shared.gaiamobile.org.
Escape character is '^]'.
This effectively causes the tests to hang for anyone running on a DNS server like this. I suppose I should look into using opendns.
Anyway, it would be nice if we could convert the code to use require() instead of requireApp() for the shared resources. This allows the setup code to run as intended.
| Assignee | ||
Comment 1•12 years ago
|
||
Pull request converting requireApp() to require() for the two shared/js resources I see with this issue.
Attachment #799065 -
Flags: review?(dflanagan)
| Assignee | ||
Updated•12 years ago
|
Attachment #799065 -
Attachment mime type: text/plain → text/html
| Assignee | ||
Comment 2•12 years ago
|
||
Using requireApp)() here also appears to cause tests to fail when running gallery tests independently by modifying their file. The error looks like:
1) [gallery] "before all" hook:
TypeError: navigator.mozL10n is undefined
at (anonymous) (http://gallery.gaiamobile.org:8080/test/unit/setup.js:22)
at wrapper (http://test-agent.gaiamobile.org:8080/common/test/mocha_generators.js:60)
at run (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3709)
at next (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3973)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:3984)
at (anonymous) (http://test-agent.gaiamobile.org:8080/common/vendor/mocha/mocha.js:4932)
Comment 3•12 years ago
|
||
Comment on attachment 799065 [details]
Pull request at https://github.com/mozilla-b2g/gaia/pull/11913
Thanks for fixing this.
Attachment #799065 -
Flags: review?(dflanagan) → review+
| Assignee | ||
Comment 4•12 years ago
|
||
Thanks for the review! Merged:
https://github.com/mozilla-b2g/gaia/commit/f11eb9ca03420f5a1602d66ec6bced59fadd696b
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•