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

Issue 11359100: Add RunCallback to invoke a callback parameter in unittests. (Closed)

Created:
8 years, 1 month ago by xhwang
Modified:
8 years, 1 month ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Add RunCallback to invoke a callback parameter in unittests. In gmock, ::testing::InvokeArgument doesn't support chromium base::Callback. Adding customized templated action RunCallback to support this. Also added new matchers for base::callback. BUG=none TEST=Added unittests to test the new matchers and actions. Updated media_unittests to use the new matchers and actions. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=167309

Patch Set 1 #

Patch Set 2 : drop .pump file and update more tests #

Patch Set 3 : fix typo #

Total comments: 2

Patch Set 4 : rebase only #

Patch Set 5 : remove pump header #

Patch Set 6 : rename #

Unified diffs Side-by-side diffs Delta from patch set Stats (+345 lines, -197 lines) Patch
A media/base/gmock_callback_support.h View 1 2 3 4 5 1 chunk +107 lines, -0 lines 0 comments Download
A media/base/gmock_callback_support_unittest.cc View 1 2 3 4 5 1 chunk +84 lines, -0 lines 0 comments Download
M media/base/mock_filters.h View 1 chunk +0 lines, -4 lines 0 comments Download
M media/base/pipeline_unittest.cc View 1 2 3 4 5 19 chunks +90 lines, -98 lines 0 comments Download
M media/filters/audio_renderer_impl_unittest.cc View 1 2 3 4 5 6 chunks +6 lines, -9 lines 0 comments Download
M media/filters/decrypting_audio_decoder_unittest.cc View 1 2 3 4 5 12 chunks +22 lines, -37 lines 0 comments Download
M media/filters/decrypting_video_decoder_unittest.cc View 1 2 3 4 5 12 chunks +20 lines, -31 lines 0 comments Download
M media/filters/ffmpeg_video_decoder_unittest.cc View 1 2 3 4 5 6 chunks +8 lines, -11 lines 0 comments Download
M media/filters/video_renderer_base_unittest.cc View 1 2 3 4 5 6 chunks +6 lines, -7 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
xhwang
As discussed in https://groups.google.com/a/chromium.org/forum/?fromgroups=#!topic/chromium-dev/eAPmK8T8pYA I'll update more tests if this CL looks good. PTAL!
8 years, 1 month ago (2012-11-08 09:16:24 UTC) #1
scherkus (not reviewing)
super cool! Is it possible to drop the template parameter for RunClosure<T>, perhaps by using ...
8 years, 1 month ago (2012-11-08 17:58:26 UTC) #2
xhwang
On 2012/11/08 17:58:26, scherkus wrote: > super cool! > > Is it possible to drop ...
8 years, 1 month ago (2012-11-08 18:15:44 UTC) #3
scherkus (not reviewing)
On 2012/11/08 18:15:44, xhwang wrote: > On 2012/11/08 17:58:26, scherkus wrote: > > super cool! ...
8 years, 1 month ago (2012-11-08 18:17:07 UTC) #4
awong
For something so simple, can we avoid the pump file? People on chrome team seem ...
8 years, 1 month ago (2012-11-08 20:44:41 UTC) #5
awong
Also, can we move callback_util.h into something appropriate in testing? Ideally, it should replace gmock_mutant.h ...
8 years, 1 month ago (2012-11-08 20:46:12 UTC) #6
awong
...with a better name... On Thu, Nov 8, 2012 at 12:46 PM, <ajwong@chromium.org> wrote: > ...
8 years, 1 month ago (2012-11-08 20:46:48 UTC) #7
xhwang
As chatted offline w/ awong@, I'll make this into media/ first then see opportunities to ...
8 years, 1 month ago (2012-11-09 02:54:51 UTC) #8
scherkus (not reviewing)
http://codereview.chromium.org/11359100/diff/6002/media/base/callback_util.h File media/base/callback_util.h (right): http://codereview.chromium.org/11359100/diff/6002/media/base/callback_util.h#newcode2 media/base/callback_util.h:2: // pump.py callback_util.h.pump I don't see us checking in ...
8 years, 1 month ago (2012-11-12 17:26:03 UTC) #9
xhwang
PTAL again! http://codereview.chromium.org/11359100/diff/6002/media/base/callback_util.h File media/base/callback_util.h (right): http://codereview.chromium.org/11359100/diff/6002/media/base/callback_util.h#newcode2 media/base/callback_util.h:2: // pump.py callback_util.h.pump On 2012/11/12 17:26:03, scherkus ...
8 years, 1 month ago (2012-11-12 18:30:34 UTC) #10
scherkus (not reviewing)
lgtm but I would like a better name callback_util contains no hint that this is ...
8 years, 1 month ago (2012-11-12 18:35:38 UTC) #11
awong
LGTM for callback, but agree with scherkus that callback_util is not informative enough. Passing review ...
8 years, 1 month ago (2012-11-12 18:39:31 UTC) #12
xhwang
On 2012/11/12 18:35:38, scherkus wrote: > lgtm but I would like a better name > ...
8 years, 1 month ago (2012-11-12 19:34:19 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/xhwang@chromium.org/11359100/2004
8 years, 1 month ago (2012-11-12 19:52:00 UTC) #14
commit-bot: I haz the power
8 years, 1 month ago (2012-11-13 05:49:49 UTC) #15
Change committed as 167309

Powered by Google App Engine
This is Rietveld 408576698