Closed
Bug 1234340
Opened 9 years ago
Closed 9 years ago
Gaia test incorrectly assign to / use primitive strings instead of objects
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: evilpies, Assigned: evilpies)
References
Details
Attachments
(4 files)
Multiple Gaia test use simple strings for mocking. However bug 603201 makes that illegal. (Because this makes no sense, after assigning to primitive string the property just disappears)
So instead this should be using real objects, maybe just new String("test") or something.
TEST-UNEXPECTED-FAIL | communications/contacts/test/unit/import/import_test.js | Import Friends Test Suite Import process Number of contacts available to import If fb contacts < device contacts, 0 - can't assign to properties of (new String("contact1")): not an object
TypeError: can't assign to properties of (new String("contact1")): not an object
TEST-UNEXPECTED-FAIL | communications/contacts/test/unit/import/import_test.js | Import Friends Test Suite Import process Number of contacts available to import If fb contacts = device contacts, 0 - can't assign to properties of (new String("contact1")): not an object
TypeError: can't assign to properties of (new String("contact1")): not an object
TEST-UNEXPECTED-FAIL | communications/contacts/test/unit/import/import_test.js | Import Friends Test Suite Import process Number of contacts available to import If fb contacts > device contacts, >0 - can't assign to properties of (new String("contact1")): not an object
TypeError: can't assign to properties of (new String("contact1")): not an object
TEST-UNEXPECTED-FAIL | clock/test/unit/panels/timer/timer_panel_test.js | Timer.Panel Timer.Panel, Events "before each" hook - can't assign to properties of (new String("{\"duration\":5000}")): not an object
1147865 Intermittent clock/test/unit/panels/timer/timer_panel_test.js | Timer.Panel "before each" hook - NotFoundError: The operation failed because the requested database object could not be found. For example, an object store did not exist but was being opened.
TypeError: can't assign to properties of (new String("{\"duration\":5000}")): not an object
TEST-UNEXPECTED-FAIL | sharedtest/test/unit/dialer/contacts_test.js | dialer/contacts > Contacts Revision > Should return revision - can't assign to properties of (new String("fakeRevision")): not an object
1068629 Intermittent ice_contacts_test.js | ICE contacts bar Initialization Sets header overlay title - timeout of 10000ms exceeded
TypeError: can't assign to properties of (new String("fakeRevision")): not an object
TEST-UNEXPECTED-FAIL | sharedtest/test/unit/sticky_header_test.js | "after each" hook - TypeError: this.sinon is null (app://sharedtest.gaiamobile.org/test/unit/sticky_header_test.js?time=1450728283382:69)
1234189 Intermittent sharedtest/test/unit/sticky_header_test.js | "after each" hook - TypeError: this.sinon is null (app://sharedtest.gaiamobile.org/test/unit
TEST-UNEXPECTED-FAIL | system/test/unit/nfc_manager_test.js | Nfc Manager Functions _fireNDEFDiscovered _createNDEFActivityOptions called with proper args - can't assign to properties of (new String("decoded")): not an object
TypeError: can't assign to properties of (new String("decoded")): not an object
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → evilpies
| Assignee | ||
Comment 1•9 years ago
|
||
I tried pushing to try with a customized gaia, not sure if it will work.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d3e68002b079
https://github.com/evilpie/gaia/commit/5e207dc57ed4d5e63a5a89e22873a6904f0221ed
| Assignee | ||
Comment 2•9 years ago
|
||
I unsuccessfully tried to fix import_test.js in https://github.com/evilpie/gaia/commit/5e207dc57ed4d5e63a5a89e22873a6904f0221ed. Can you check this out? Maybe the other failures as well?
Flags: needinfo?(francisco)
| Assignee | ||
Comment 3•9 years ago
|
||
I think I fixed everything, but import_test.js now. Maybe that test actually relies on not being able to assign properties to the different contacts? https://github.com/mozilla-b2g/gaia/compare/master...evilpie:master
| Assignee | ||
Comment 4•9 years ago
|
||
Apparently this test suite was disabled in bug 1236835. Good for me.
Comment 5•9 years ago
|
||
| Assignee | ||
Comment 6•9 years ago
|
||
I think this should be enough for Mulet.
Attachment #8708323 -
Flags: review?(francisco)
| Assignee | ||
Comment 7•9 years ago
|
||
Comment on attachment 8708323 [details] [review]
Fix some b2g failures
Or Fabrice maybe? Not sure who to ask.
Attachment #8708323 -
Flags: review?(fabrice)
Comment 8•9 years ago
|
||
Updated•9 years ago
|
Attachment #8708398 -
Flags: review?(francisco)
Comment 9•9 years ago
|
||
Comment on attachment 8708398 [details] [review]
[gaia] julienw:1234340-fix-bad-contacts-test > mozilla-b2g:master
Hey Gabriele,
Francisco thought we could just as well remove this test as the code it tests could be removed as well... (although I don't want to do this now). What do you think ?
Attachment #8708398 -
Flags: review?(francisco) → review?(gsvelto)
Comment 10•9 years ago
|
||
Comment 11•9 years ago
|
||
Comment on attachment 8708433 [details] [review]
[gaia] julienw:1234340-fix-bad-contacts-test-2 > mozilla-b2g:master
The issue here is that we need to use real objects. So I use a more mozContact-like object with a "name" and also a "uid" property that seems to be used directly in importer_ui.js (function "friendsReady"). Also I changed getContactUid to actually return the same "uid" property.
What do you think Francisco ?
Flags: needinfo?(francisco)
Attachment #8708433 -
Flags: review?(francisco)
Comment 12•9 years ago
|
||
Comment on attachment 8708323 [details] [review]
Fix some b2g failures
r? from tim for the NFC test as I'm not sure about what this does. It seems legit to me.
r? from mcav for the clock test. It seems totally good to me as well.
Attachment #8708323 -
Flags: review?(timdream)
Attachment #8708323 -
Flags: review?(m)
Attachment #8708323 -
Flags: review?(francisco)
Attachment #8708323 -
Flags: review?(fabrice)
Updated•9 years ago
|
Attachment #8708323 -
Flags: review?(m) → review+
Updated•9 years ago
|
Attachment #8708323 -
Flags: review?(timdream) → review+
Comment 13•9 years ago
|
||
Comment on attachment 8708398 [details] [review]
[gaia] julienw:1234340-fix-bad-contacts-test > mozilla-b2g:master
(In reply to Julien Wajsberg [:julienw] (PTO -> 2016) from comment #9)
> Francisco thought we could just as well remove this test as the code it
> tests could be removed as well... (although I don't want to do this now).
> What do you think ?
Let's keep it for now, the dialer code is going through a lot of churn already and I don't want to change it more before we land bug 1227980.
Attachment #8708398 -
Flags: review?(gsvelto) → review+
Comment 14•9 years ago
|
||
Comment on attachment 8708433 [details] [review]
[gaia] julienw:1234340-fix-bad-contacts-test-2 > mozilla-b2g:master
LGTM, thanks Julien
Attachment #8708433 -
Flags: review?(francisco) → review+
Comment 15•9 years ago
|
||
https://github.com/mozilla-b2g/gaia/commit/4dc1da3ad30c1ce630612f42aa7520e577898ebe
https://github.com/mozilla-b2g/gaia/commit/cff00655a2cb1c40d78bd191f935df307a8677c1
https://github.com/mozilla-b2g/gaia/commit/6bfef7d59c491456899a1324312a87bcd57701fd
(sorry gabriele, I forgot to edit the commit log, so francisco is credited as reviewer instead :/)
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•