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)

ARM
Gonk (Firefox OS)
defect
Not set
normal

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: nobody → evilpies
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)
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
Apparently this test suite was disabled in bug 1236835. Good for me.
Attached file Fix some b2g failures
I think this should be enough for Mulet.
Attachment #8708323 - Flags: review?(francisco)
Comment on attachment 8708323 [details] [review] Fix some b2g failures Or Fabrice maybe? Not sure who to ask.
Attachment #8708323 - Flags: review?(fabrice)
Attachment #8708398 - Flags: review?(francisco)
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 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 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)
Attachment #8708323 - Flags: review?(m) → review+
Attachment #8708323 - Flags: review?(timdream) → review+
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 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+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: