[Clock] Refactor Stopwatch API

RESOLVED FIXED

Status

Firefox OS
Gaia::Clock
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: evhan55, Assigned: evhan55)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
Refactor and re-implement Stopwatch API.  Write tests for it.
(Assignee)

Updated

4 years ago
Assignee: nobody → evelyn
(Assignee)

Updated

4 years ago
Summary: Refactor Stopwatch API → [Clock] Refactor Stopwatch API
(Assignee)

Updated

4 years ago
Blocks: 909394
Update to reflect User Story dependencies
(Assignee)

Comment 2

4 years ago
Created attachment 797424 [details] [review]
https://github.com/mozilla-b2g/gaia/pull/11846

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)
(Assignee)

Comment 4

4 years ago
Wooh, thanks, captain! Will do!
(Assignee)

Updated

4 years ago
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
Last Resolved: 4 years ago
Resolution: --- → FIXED
(Assignee)

Comment 7

4 years ago
hooray!
https://hg.mozilla.org/mozilla-central/rev/3335f50ebaba
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.