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

Issue 1919005: Add some basic tests for metrics_daemon. (Closed)

Created:
10 years, 7 months ago by petkov
Modified:
9 years, 7 months ago
Reviewers:
kmixter1, sosa
CC:
chromium-os-reviews_chromium.org, Luigi Semenzato, sosa
Base URL:
ssh://git@chromiumos-git/chromeos
Visibility:
Public.

Description

Add some basic tests for metrics_daemon. A separate CL adds a test stanza to the metrics ebuild. More tests (specifically, for the D-Bus MessageFilter) will also come in a separate CL.

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address review comments. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+567 lines, -44 lines) Patch
M src/platform/metrics/Makefile View 1 4 chunks +8 lines, -6 lines 0 comments Download
A src/platform/metrics/make_tests.sh View 1 chunk +12 lines, -0 lines 0 comments Download
M src/platform/metrics/metrics_daemon.h View 1 4 chunks +32 lines, -5 lines 0 comments Download
M src/platform/metrics/metrics_daemon.cc View 1 9 chunks +47 lines, -20 lines 1 comment Download
M src/platform/metrics/metrics_daemon_main.cc View 1 chunk +1 line, -1 line 0 comments Download
A src/platform/metrics/metrics_daemon_test.cc View 1 1 chunk +459 lines, -0 lines 1 comment Download
D src/platform/metrics/metrics_daemon_unittest.cc View 1 chunk +0 lines, -10 lines 0 comments Download
M src/scripts/build_tests.sh View 1 2 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
petkov
10 years, 7 months ago (2010-05-05 17:53:37 UTC) #1
sosa
http://codereview.chromium.org/1919005/diff/1/2 File src/platform/metrics/Makefile (right): http://codereview.chromium.org/1919005/diff/1/2#newcode15 src/platform/metrics/Makefile:15: DAEMON_TEST = metrics_deamon_test Misspelling of daemon? http://codereview.chromium.org/1919005/diff/1/7 File src/platform/metrics/metrics_daemon_test.cc ...
10 years, 7 months ago (2010-05-05 21:46:56 UTC) #2
petkov
Thanks for the quick review. PTAL. http://codereview.chromium.org/1919005/diff/1/2 File src/platform/metrics/Makefile (right): http://codereview.chromium.org/1919005/diff/1/2#newcode15 src/platform/metrics/Makefile:15: DAEMON_TEST = metrics_deamon_test ...
10 years, 7 months ago (2010-05-05 23:03:34 UTC) #3
sosa
lgtm On Wed, May 5, 2010 at 4:03 PM, <petkov@chromium.org> wrote: > Thanks for the ...
10 years, 7 months ago (2010-05-05 23:04:11 UTC) #4
kmixter1
FYI Nice! http://codereview.chromium.org/1919005/diff/5001/6003 File src/platform/metrics/metrics_daemon.cc (right): http://codereview.chromium.org/1919005/diff/5001/6003#newcode401 src/platform/metrics/metrics_daemon.cc:401: if (testing_) Ideally you'd want to make ...
10 years, 7 months ago (2010-05-10 19:06:30 UTC) #5
petkov
10 years, 7 months ago (2010-05-10 22:28:02 UTC) #6
Thanks for looking at this.

On 2010/05/10 19:06:30, kmixter1 wrote:
> FYI
> 
> Nice!
> 
> http://codereview.chromium.org/1919005/diff/5001/6003
> File src/platform/metrics/metrics_daemon.cc (right):
> 
> http://codereview.chromium.org/1919005/diff/5001/6003#newcode401
> src/platform/metrics/metrics_daemon.cc:401: if (testing_)
> Ideally you'd want to make this function available through a fake/mock object.

Yes, I kind of followed the existing code. I'm also considering mocking time,
glib, dbus to make the unit test more complete...

> 
> http://codereview.chromium.org/1919005/diff/5001/6006
> File src/platform/metrics/metrics_daemon_test.cc (right):
> 
> http://codereview.chromium.org/1919005/diff/5001/6006#newcode126
> src/platform/metrics/metrics_daemon_test.cc:126: bool NoOrEmptyUseRecordFile()
{
> Function names should start with verb

Good to know, I'll fix. The style guide kind of mentions it in one place but
then gives "MyExcitingMethod()" as an example.

Powered by Google App Engine
This is Rietveld 408576698