Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Issue 11607003: Add a Clock and TickClock interface for mocking out time (Closed)

Created:
8 years ago by akalin
Modified:
7 years, 10 months ago
CC:
chromium-reviews, Raghu Simha, feature-media-reviews_chromium.org, haitaol1, erikwright+watch_chromium.org, tim (not reviewing), jar (doing other things), Denis Kuznetsov (DE-MUC)
Visibility:
Public.

Description

Add a Clock and TickClock interface for mocking out time Add DefaultClock and DefaultTickClock implementations. Add SimpleTestClock and SimpleTestTickClock implementations for test. Port some classes in sync/ and media/ to use SimpleTest{,Tick}Clock. BUG=166469 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=183865

Patch Set 1 #

Total comments: 14

Patch Set 2 : Address comments #

Total comments: 1

Patch Set 3 : Rebase onto HEAD #

Patch Set 4 : Rebase #

Patch Set 5 : Address comments #

Patch Set 6 : Fix warnings #

Unified diffs Side-by-side diffs Delta from patch set Stats (+375 lines, -119 lines) Patch
M base/base.gyp View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download
M base/test/mock_time_provider.h View 1 chunk +3 lines, -0 lines 0 comments Download
A base/test/simple_test_clock.h View 1 2 3 4 5 1 chunk +39 lines, -0 lines 0 comments Download
A base/test/simple_test_clock.cc View 1 chunk +23 lines, -0 lines 0 comments Download
A base/test/simple_test_tick_clock.h View 1 2 3 4 5 1 chunk +39 lines, -0 lines 0 comments Download
A base/test/simple_test_tick_clock.cc View 1 1 chunk +26 lines, -0 lines 0 comments Download
A base/time/clock.h View 1 2 3 4 1 chunk +40 lines, -0 lines 0 comments Download
A + base/time/clock.cc View 1 2 3 4 1 chunk +6 lines, -2 lines 0 comments Download
A base/time/default_clock.h View 1 2 3 4 1 chunk +25 lines, -0 lines 0 comments Download
A + base/time/default_clock.cc View 1 2 3 4 1 chunk +4 lines, -6 lines 0 comments Download
A base/time/default_tick_clock.h View 1 2 3 4 1 chunk +25 lines, -0 lines 0 comments Download
A + base/time/default_tick_clock.cc View 1 2 3 4 1 chunk +4 lines, -6 lines 0 comments Download
A base/time/tick_clock.h View 1 2 3 4 1 chunk +40 lines, -0 lines 0 comments Download
A + base/time/tick_clock.cc View 1 2 3 4 1 chunk +6 lines, -2 lines 0 comments Download
M media/base/clock.h View 3 chunks +6 lines, -8 lines 0 comments Download
M media/base/clock.cc View 1 2 3 4 3 chunks +5 lines, -11 lines 0 comments Download
M media/base/clock_unittest.cc View 1 2 3 4 3 chunks +6 lines, -9 lines 0 comments Download
M media/base/pipeline.h View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M media/base/pipeline.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M media/base/pipeline_unittest.cc View 1 2 3 4 6 chunks +6 lines, -11 lines 0 comments Download
M sync/notifier/ack_tracker.h View 1 2 3 4 chunks +7 lines, -4 lines 0 comments Download
M sync/notifier/ack_tracker.cc View 1 2 3 4 5 chunks +7 lines, -12 lines 0 comments Download
M sync/notifier/ack_tracker_unittest.cc View 1 2 3 4 12 chunks +40 lines, -47 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
akalin
+brettw for base/ and overall review +rlarocque for sync/ +scherkus for media/
8 years ago (2012-12-17 19:44:20 UTC) #1
Ryan Sleevi
https://codereview.chromium.org/11607003/diff/1/base/default_clock.cc File base/default_clock.cc (right): https://codereview.chromium.org/11607003/diff/1/base/default_clock.cc#newcode12 base/default_clock.cc:12: LazyInstance<DefaultClock> default_clock = LAZY_INSTANCE_INITIALIZER; DESIGN: Should this be Leaky, ...
8 years ago (2012-12-17 19:54:45 UTC) #2
awong
drive-by nits. No need to wait for my LG. https://codereview.chromium.org/11607003/diff/1/base/default_clock.cc File base/default_clock.cc (right): https://codereview.chromium.org/11607003/diff/1/base/default_clock.cc#newcode12 base/default_clock.cc:12: ...
8 years ago (2012-12-17 19:55:11 UTC) #3
jar (doing other things)
It bugs me a bit that we can't control the global TimeTicks, and hence we ...
8 years ago (2012-12-17 20:29:21 UTC) #4
rlarocque
Sync changes LGTM.
8 years ago (2012-12-17 20:38:44 UTC) #5
akalin
Comments addressed, PTAL https://codereview.chromium.org/11607003/diff/1/base/default_clock.cc File base/default_clock.cc (right): https://codereview.chromium.org/11607003/diff/1/base/default_clock.cc#newcode12 base/default_clock.cc:12: LazyInstance<DefaultClock> default_clock = LAZY_INSTANCE_INITIALIZER; On 2012/12/17 ...
8 years ago (2012-12-17 22:38:31 UTC) #6
akalin
Pasting in Brett's comments from the other thread: On Mon, Dec 17, 2012 at 12:15 ...
8 years ago (2012-12-17 23:20:10 UTC) #7
scherkus (not reviewing)
media/ lgtm https://codereview.chromium.org/11607003/diff/21001/media/base/pipeline_unittest.cc File media/base/pipeline_unittest.cc (left): https://codereview.chromium.org/11607003/diff/21001/media/base/pipeline_unittest.cc#oldcode586 media/base/pipeline_unittest.cc:586: static base::Time StaticClockFunction() { haha wow am ...
8 years ago (2012-12-17 23:25:47 UTC) #8
akalin
Pasting in my reply to Brett's comments: On Mon, Dec 17, 2012 at 12:50 PM, ...
8 years ago (2012-12-17 23:30:12 UTC) #9
akalin
Pasting in Scott's reply: > On Mon, Dec 17, 2012 at 2:25 PM, Scott Violet ...
8 years ago (2012-12-17 23:32:23 UTC) #10
Denis Kuznetsov (DE-MUC)
On 2012/12/17 23:32:23, akalin wrote: > Pasting in Scott's reply: > > > On Mon, ...
8 years ago (2012-12-18 13:40:57 UTC) #11
akalin
On 2012/12/18 13:40:57, Denis Kuznetsov wrote: > Just my two cents: this approach would not ...
8 years ago (2012-12-18 16:24:10 UTC) #12
Denis Kuznetsov (DE-MUC)
On 2012/12/18 16:24:10, akalin wrote: > On 2012/12/18 13:40:57, Denis Kuznetsov wrote: > > Just ...
8 years ago (2012-12-19 13:41:57 UTC) #13
Denis Kuznetsov (DE-MUC)
In other words, this approach is nice when you need to test time-dependant class directly. ...
8 years ago (2012-12-19 16:40:33 UTC) #14
Nikita (slow)
+Ian for considerations on animations testing (see latest comments by Denis)
8 years ago (2012-12-21 11:47:59 UTC) #15
Denis Kuznetsov (DE-MUC)
I think that correct time mocking should look like this: * Mocking should be installed ...
8 years ago (2012-12-21 12:41:45 UTC) #16
akalin
On Fri, Dec 21, 2012 at 4:41 AM, <antrim@chromium.org> wrote: > I think that correct ...
8 years ago (2012-12-22 07:50:38 UTC) #17
Denis Kuznetsov (DE-MUC)
On 2012/12/22 07:50:38, akalin wrote: > On Fri, Dec 21, 2012 at 4:41 AM, <mailto:antrim@chromium.org> ...
7 years, 12 months ago (2012-12-26 12:08:58 UTC) #18
akalin
Hello, everyone. I'm resurrecting this CL. Brett, do you still have concerns? I think everyone ...
7 years, 10 months ago (2013-02-20 21:32:55 UTC) #19
brettw
I spoke to some people. I think it's the same: nobody really cares that much ...
7 years, 10 months ago (2013-02-20 23:37:18 UTC) #20
akalin
On 2013/02/20 23:37:18, brettw wrote: > I spoke to some people. I think it's the ...
7 years, 10 months ago (2013-02-21 01:11:43 UTC) #21
brettw
base lgtm
7 years, 10 months ago (2013-02-21 18:15:06 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/akalin@chromium.org/11607003/39001
7 years, 10 months ago (2013-02-21 18:19:41 UTC) #23
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 10 months ago (2013-02-21 19:04:34 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/akalin@chromium.org/11607003/44004
7 years, 10 months ago (2013-02-21 19:44:54 UTC) #25
akalin
7 years, 10 months ago (2013-02-21 21:50:52 UTC) #26
Message was sent while issue was closed.
Committed patchset #6 manually as r183865 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698