Closed
Bug 1230683
Opened 9 years ago
Closed 8 years ago
Cleanup test_storage_connection.js
Categories
(Toolkit :: Storage, defect)
Toolkit
Storage
Tracking
()
RESOLVED
FIXED
mozilla47
People
(Reporter: mak, Assigned: tranj23)
Details
(Whiteboard: [good first bug][lang=js])
Attachments
(1 file, 1 obsolete file)
4.38 KB,
patch
|
mak
:
review+
|
Details | Diff | Splinter Review |
The test can use Assert.throws instead of plain try/catch
Assignee | ||
Comment 1•8 years ago
|
||
I replaced some try/catch statements with Assert.throws in test_storage_connection.js. Then I ran the test on my local machine and all tests passed.
Attachment #8714049 -
Flags: review?(mak77)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → tranj23
Reporter | ||
Comment 2•8 years ago
|
||
Comment on attachment 8714049 [details] [diff] [review] rev1 - Replace try/catch with Assert.throws in test_storage_connection.js Review of attachment 8714049 [details] [diff] [review]: ----------------------------------------------------------------- ::: storage/test/unit/test_storage_connection.js @@ +67,5 @@ > > add_task(function* test_createTable_already_created() { > var msc = getOpenedDatabase(); > do_check_true(msc.tableExists("test")); > + throws(() => msc.createTable("test", "id INTEGER PRIMARY KEY, name TEXT"), /NS_ERROR_FAILURE/); A couple things: 1. I know it works, but for readability reasons I prefer if the "Assert." part is explicit, so Assert.throws, so that it's clear where this comes from. 2. please put the error regex on the second line aligned as Assert.throws(() => {}, /NS_ERROR_FAILURE/); since we still have an 80 columns soft-barrier in the coding style This is valid for all instances where this appears @@ +267,5 @@ > let stmt = createStatement("SELECT * FROM test"); > stmt.executeAsync(); > stmt.finalize(); > > + let db = getOpenedDatabase(); trailing spaces here
Attachment #8714049 -
Flags: review?(mak77)
Assignee | ||
Comment 3•8 years ago
|
||
Ok I made changes based on the review feedback of previous patch
Attachment #8714049 -
Attachment is obsolete: true
Attachment #8716383 -
Flags: review?(mak77)
Reporter | ||
Comment 4•8 years ago
|
||
Comment on attachment 8716383 [details] [diff] [review] rev2 - Replace try/catch with Assert.throws in test_storage_connection.js Review of attachment 8716383 [details] [diff] [review]: ----------------------------------------------------------------- thanks you, it looks good to me, I'll push to the TryServer.
Attachment #8716383 -
Flags: review?(mak77) → review+
Reporter | ||
Comment 5•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ab419d75f5e0
Comment 7•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4aaaefe703ae
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•