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

Issue 1264123002: HistogramTester::GetHistogramSamplesSinceCreation never returns null (Closed)

Created:
5 years, 4 months ago by vabr (Chromium)
Modified:
5 years, 4 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

HistogramTester::GetHistogramSamplesSinceCreation never returns null Currently, GetHistogramSamplesSinceCreation can return null if no histogram was generated. But that depends also on tests run prior to the current test. This CL changes this to returning empty samples instead, so that independently of previously run tests, the current test always gets the same response even if it does not generate any histograms. BUG=473689 Committed: https://crrev.com/ae9604308c926cc7df6205b5207dbf63c6e55314 Cr-Commit-Position: refs/heads/master@{#341498}

Patch Set 1 #

Patch Set 2 : Fix compile #

Patch Set 3 : Add one test, fix more #

Patch Set 4 : Just rebased #

Total comments: 2

Patch Set 5 : sql tests simplified #

Total comments: 2

Patch Set 6 : Just rebased #

Patch Set 7 : No static initializers #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -15 lines) Patch
M base/test/histogram_tester.cc View 1 2 chunks +8 lines, -1 line 0 comments Download
M base/test/histogram_tester_unittest.cc View 1 2 3 4 5 6 2 chunks +22 lines, -9 lines 2 comments Download
M sql/connection_unittest.cc View 1 2 3 4 3 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 19 (6 generated)
vabr (Chromium)
Hi all, @phajdan.jr -- please review the whole patch. @atwilson -- please review chrome/browser/signin/cross_device_promo_unittest.cc Thanks! ...
5 years, 4 months ago (2015-07-31 10:36:00 UTC) #2
Andrew T Wilson (Slow)
lgtm
5 years, 4 months ago (2015-07-31 12:58:21 UTC) #3
Lei Zhang
https://codereview.chromium.org/1264123002/diff/60001/base/test/histogram_tester.cc File base/test/histogram_tester.cc (right): https://codereview.chromium.org/1264123002/diff/60001/base/test/histogram_tester.cc#newcode123 base/test/histogram_tester.cc:123: return scoped_ptr<HistogramSamples>(new SampleMap); GetHistogramSamplesSinceCreation() now always return a non-null ...
5 years, 4 months ago (2015-07-31 18:30:59 UTC) #5
vabr (Chromium)
-atwilson, as his file is gone after rebase +gbillock: Could you please review sql/connection_unittest.cc? Thanks ...
5 years, 4 months ago (2015-07-31 18:49:45 UTC) #7
Lei Zhang
+shess
5 years, 4 months ago (2015-07-31 21:45:02 UTC) #9
Lei Zhang
lgtm, please address the static initializers if possible. https://codereview.chromium.org/1264123002/diff/70003/base/test/histogram_tester_unittest.cc File base/test/histogram_tester_unittest.cc (right): https://codereview.chromium.org/1264123002/diff/70003/base/test/histogram_tester_unittest.cc#newcode47 base/test/histogram_tester_unittest.cc:47: const ...
5 years, 4 months ago (2015-07-31 21:48:20 UTC) #10
Scott Hess - ex-Googler
Definitely LGTM from sql/ side. Maybe I should have complained about it (or complained more).
5 years, 4 months ago (2015-08-01 15:08:16 UTC) #11
vabr (Chromium)
Thanks all! Comment addressed, sending to the CQ. @thestig -- please read my second comment, ...
5 years, 4 months ago (2015-08-03 07:33:37 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1264123002/110001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1264123002/110001
5 years, 4 months ago (2015-08-03 07:33:52 UTC) #15
commit-bot: I haz the power
Committed patchset #7 (id:110001)
5 years, 4 months ago (2015-08-03 08:13:05 UTC) #16
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/ae9604308c926cc7df6205b5207dbf63c6e55314 Cr-Commit-Position: refs/heads/master@{#341498}
5 years, 4 months ago (2015-08-03 08:13:53 UTC) #17
Lei Zhang
https://codereview.chromium.org/1264123002/diff/110001/base/test/histogram_tester_unittest.cc File base/test/histogram_tester_unittest.cc (right): https://codereview.chromium.org/1264123002/diff/110001/base/test/histogram_tester_unittest.cc#newcode17 base/test/histogram_tester_unittest.cc:17: static const char kHistogram1[] = "Test1"; On 2015/08/03 07:33:37, ...
5 years, 4 months ago (2015-08-03 18:00:30 UTC) #18
vabr (Chromium)
5 years, 4 months ago (2015-08-04 10:24:36 UTC) #19
Message was sent while issue was closed.
On 2015/08/03 18:00:30, Lei Zhang wrote:
>
https://codereview.chromium.org/1264123002/diff/110001/base/test/histogram_te...
> File base/test/histogram_tester_unittest.cc (right):
> 
>
https://codereview.chromium.org/1264123002/diff/110001/base/test/histogram_te...
> base/test/histogram_tester_unittest.cc:17: static const char kHistogram1[] =
> "Test1";
> On 2015/08/03 07:33:37, vabr (Chromium) wrote:
> > @thestig -- Here I followed you request literally, marking the constants as
> > static.
> > 
> > However, unlike on line 47, where "static" means that the constant is
> allocated
> > outside of the stack and spans the whole program execution, here it means
that
> > the constants are not visible outside of this file (while non-stack
allocation
> > and whole-execution-lifespan are implicit).
> > 
> > If I were writing the code as new, I would use anonymous namespace instead
of
> > "static" here (and also move "namespace base" just before line 23).
> > 
> > I cannot assume your approval for that, so I will keep it as you literally
> told
> > me in this CL. But if you want me to do any follow-ups, I'll be happy to,
just
> > let me know.
> 
> An anonymous namespace would have been fine. I should have been more clear.

Thanks! I uploaded https://codereview.chromium.org/1271933002/ for that.

Powered by Google App Engine
This is Rietveld 408576698