Closed Bug 909386 Opened 11 years ago Closed 11 years ago

[Clock] Refactor Stopwatch API

Categories

(Firefox OS Graveyard :: Gaia::Clock, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: evhan55, Assigned: evhan55)

References

Details

Attachments

(1 file)

Refactor and re-implement Stopwatch API.  Write tests for it.
Assignee: nobody → evelyn
Summary: Refactor Stopwatch API → [Clock] Refactor Stopwatch API
Blocks: 909394
Update to reflect User Story dependencies
New Stopwatch API

start() starts the stopwatch
getElapsedTime() gets a Date object storing the duration since starting the stopwatch
pause() pauses the stopwatch
lap() returns a Date object storing the duration since the last lap, or if no last lap, since starting the stopwatch
reset() sets the stopwatch's elapsed time back to 0

Tests

tested the API functions in their own suites, leaving out start() since its encompassed by the test for getElapsedTime()

Questions

not sure if the view needs the model to return a list of all lap times, can the view handle that list itself?
Attachment #797424 - Flags: review?(mike)
Comment on attachment 797424 [details] [review]
https://github.com/mozilla-b2g/gaia/pull/11846

This is a good first pass, Evelyn! I've left comments on the pull request on GitHub. Please re-set the "review" flag when you'd like me to take another look.
Attachment #797424 - Flags: review?(mike)
Wooh, thanks, captain! Will do!
Attachment #797424 - Flags: review?(mike)
Comment on attachment 797424 [details] [review]
https://github.com/mozilla-b2g/gaia/pull/11846

Looking good, Evelyn! I'll merge this post-haste
master: https://github.com/mozilla-b2g/gaia/commit/6879d212d8f0030d64e30441dd4cdfc16415478e

Nice work :)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
hooray!
Comment on attachment 797424 [details] [review]
https://github.com/mozilla-b2g/gaia/pull/11846

Looks like I forgot to set the review flag on the patch (which has since landed in master). Setting it now for bookkeeping purposes.
Attachment #797424 - Flags: review?(mike) → review+
Attachment mime type: text/plain → text/x-github-pull-request
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: