Closed Bug 940884 Opened 12 years ago Closed 12 years ago

B2G SMS: Create MobileMessageDB.jsm

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: vicamo, Assigned: vicamo)

References

Details

Attachments

(4 files, 4 obsolete files)

+++ This bug was initially created as a clone of Bug #836542 +++ Move nearly all MobileMessageDatabaseService.js lines into a jsm so that we can have a test on it.
Simply copy MobileMessageDatabaseService.js as MobileMessageDB.jsm.
Assignee: nobody → vyang
Attachment #8336758 - Flags: review?(khuey)
Attachment #8336759 - Flags: review?(gene.lian)
This patch is to ease test cases development, so that we can have full control to database initialization process.
Attachment #8336762 - Flags: review?(gene.lian)
Attached patch part 3/3: test cases (obsolete) — Splinter Review
test cases for MobileMessageDB init/close/re-init.
Attachment #8336764 - Flags: review?(gene.lian)
These patches are based on those of bug 921918.
Depends on: 921918
Mnw failed due to bug 940881, which had already fix landed. Re-trigger again. The new test case introduced in attachment 8336764 [details] [diff] [review] passed successfully.
Blocks: 942780
Attachment #8336759 - Flags: review?(gene.lian) → review+
Comment on attachment 8336762 [details] [diff] [review] part 2.b/3: Move init functions out of MobileMessage constructor Review of attachment 8336762 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/mobilemessage/src/gonk/MobileMessageDB.jsm @@ +290,5 @@ > > /** > + * Initialize this MobileMessageDB. > + * > + * @param aName s/aName/aDbName @@ +292,5 @@ > + * Initialize this MobileMessageDB. > + * > + * @param aName > + * A string name for that database. > + * @param aVersion s/aVersion/aDbVersion
Attachment #8336762 - Flags: review?(gene.lian) → review+
Comment on attachment 8336764 [details] [diff] [review] part 3/3: test cases Review of attachment 8336764 [details] [diff] [review]: ----------------------------------------------------------------- This is awesome! Thanks! ::: dom/mobilemessage/tests/marionette/head.js @@ +350,5 @@ > + > +/* Initialize a MobileMessageDB. Resolve if initialized with success, reject > + * otherwise. > + * > + * Forfill params: a MobileMessageDB instance. s/Forfill/Fullfill @@ +361,5 @@ > + * version. > + * > + * @return A deferred promise. > + */ > +function initMobileMessageDB(aMmdb, aName, aVersion) { Where is |@param aMmdb|? @@ +381,5 @@ > + * @return The passed MobileMessageDB instance. > + */ > +function closeMobileMessageDB(aMmdb) { > + aMmdb.close(); > + return aMmdb; Why need to return?
Attachment #8336764 - Flags: review?(gene.lian) → review+
(In reply to Gene Lian [:gene] (needinfo? encouraged) from comment #9) > ::: dom/mobilemessage/tests/marionette/head.js > @@ +381,5 @@ > > + * @return The passed MobileMessageDB instance. > > + */ > > +function closeMobileMessageDB(aMmdb) { > > + aMmdb.close(); > > + return aMmdb; > > Why need to return? It was designed to be a handler for Promise. Return value of a Promise handler becomes the argument for the next handler in chain. So, returning the input argument here helps chaining up handlers easily. However, bug 943233 prevents this easy setup due to some unknown exported js object unwrapping issue. See there for details.
Blocks: 943263
No longer blocks: 942780
rebase onto bug 942780.
Attachment #8336759 - Attachment is obsolete: true
Attachment #8338427 - Flags: review+
Attachment #8338428 - Flags: review+
address comment 9.
Attachment #8336764 - Attachment is obsolete: true
Attachment #8338429 - Flags: review+
Will only land after v1.3 gets forked.
Rebase after bug 946079, bug 945711
Attachment #8338427 - Attachment is obsolete: true
Attachment #8345678 - Flags: review+
Blocks: 963426
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: