Closed
Bug 557588
Opened 14 years ago
Closed 14 years ago
code audit and create unit test plan for engines.js
Categories
(Firefox :: Sync, defect)
Firefox
Sync
Tracking
()
RESOLVED
FIXED
1.4
People
(Reporter: mconnor, Assigned: philikon)
References
Details
Attachments
(2 files, 2 obsolete files)
No description provided.
Reporter | ||
Updated•14 years ago
|
Target Milestone: --- → 1.3
Reporter | ||
Updated•14 years ago
|
Flags: blocking-weave1.3+
Reporter | ||
Updated•14 years ago
|
Whiteboard: [final]
Updated•14 years ago
|
Whiteboard: [final]
Assignee | ||
Updated•14 years ago
|
Assignee: mconnor → philipp
Assignee | ||
Comment 1•14 years ago
|
||
This is part one containing tests for everything in engine.js apart from SyncEngine.sync(), or rather the methods it calls to perform the sync. These methods rely upon various things to be set up (e.g. private/public key objects, a reasonably complete store implementation, various server methods, etc.). They are probably best tested separately, and it might make sense to come up with some generic test helpers for similar tests (e.g. for service.js).
Attachment #447196 -
Flags: review?(mconnor)
Assignee | ||
Comment 2•14 years ago
|
||
Now part two containing * a few clarifying comments regarding various constants, * a FakeCryptoService implementation (it basically doesn't encrypt ;)), * complete server side (httpd.js) implementations for WBOs and Collections, * exhaustive tests for SyncEngine.sync(), or rather its individual parts.
Attachment #447809 -
Flags: review?(mconnor)
Reporter | ||
Comment 3•14 years ago
|
||
Comment on attachment 447196 [details] [diff] [review] Part 1: Tests for EngineMangerSvc, Engine and SyncEngine sans sync() >+function test_enabled() { >+ _("Engine.enabled corresponds to preference"); >+ let engine = new SteamEngine(); >+ try { >+ do_check_false(!!engine.enabled); >+ Svc.Prefs.set("engine.steam", true); >+ do_check_true(!!engine.enabled); do we really need the !! here and elsewhere? engine.enabled should return true or false already.
Attachment #447196 -
Flags: review?(mconnor) → review+
Assignee | ||
Comment 4•14 years ago
|
||
(In reply to comment #3) > do we really need the !! here and elsewhere? engine.enabled should return true > or false already. Actually, since the value comes from a preference setting, it will initially be null. So at least the do_check_false() check would need the !!. Using do_check_false() felt more appropriate than explicitly checking for equality to null, since engine.enabled is generally thought to be of boolean nature. You're right about the do_check_true() case, though. I'll get rid of that one.
Comment 5•14 years ago
|
||
Do we just want to make the enabled api return a true/false for sure? Do we use it anywhere assuming undefined?/null
Assignee | ||
Comment 6•14 years ago
|
||
(In reply to comment #5) > Do we just want to make the enabled api return a true/false for sure? Do we use > it anywhere assuming undefined?/null No, it seems to be used as a boolean throughout. +1 to making it true/false.
Reporter | ||
Comment 7•14 years ago
|
||
We should do that. If we have somewhere distinguishing between true/false/null, I will look at blame and laugh. Or cry.
Reporter | ||
Comment 8•14 years ago
|
||
Comment on attachment 447809 [details] [diff] [review] Part 2: Tests for SyncEngine.sync(), incl some additions to harness >diff -r b08ce2c09761 source/modules/constants.js.in >-// Record size limit is currently 10K, so 100 is a bit over 1MB >+// Record size limit is currently 28K, so 100 records is a bit over 2.7MB it's 256k, actually, though the old cluster capped to 28k. Filed bug 569295 to cover being smart about total upload size. >diff -r b08ce2c09761 source/modules/engines.js >- // Figure out how many total items to fetch this sync; do less on mobile >+ // Figure out how many total items to fetch this sync; do less on mobile. >+ // 50 is hardcoded here because of URL length restrictions. >+ // (GUIDs are 10 chars) GUIDs are actually up to 64 chars under the 1.0 API. Right now we can have long things like {9a1154a9-85f6-4e49-aa9f-9c339ab12e45}33 for bookmarks.
Attachment #447809 -
Flags: review?(mconnor) → review+
Assignee | ||
Comment 9•14 years ago
|
||
Engine.enabled now always returns a boolean.
Attachment #447196 -
Attachment is obsolete: true
Assignee | ||
Comment 10•14 years ago
|
||
Fixed nits in comments.
Attachment #447809 -
Attachment is obsolete: true
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Comment 11•14 years ago
|
||
http://hg.mozilla.org/labs/weave/rev/ff0b28eef311 Tests for EngineMangerSvc, Engine and SyncEngine sans sync(). http://hg.mozilla.org/labs/weave/rev/965642249768 Tests for SyncEngine.sync(), incl some additions to harness.
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: 1.3 → 2.0
Comment 12•14 years ago
|
||
http://hg.mozilla.org/labs/weave/rev/37afbc3db445 (new url from hg magic) Tests for EngineMangerSvc, Engine and SyncEngine sans sync(). http://hg.mozilla.org/labs/weave/rev/fc08fa427202 (new url from hg magic) Tests for SyncEngine.sync(), incl some additions to harness.
Updated•14 years ago
|
Target Milestone: 2.0 → 1.4
Updated•6 years ago
|
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in
before you can comment on or make changes to this bug.
Description
•