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

Side by Side Diff: base/metrics/histogram_unittest.cc

Issue 1719363002: Collect information about failing histogram factory calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/metrics/metrics_hashes.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/metrics/histogram.h" 5 #include "base/metrics/histogram.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 int range; 567 int range;
568 EXPECT_TRUE(iter.ReadInt(&range)); 568 EXPECT_TRUE(iter.ReadInt(&range));
569 EXPECT_EQ(10, range); 569 EXPECT_EQ(10, range);
570 EXPECT_TRUE(iter.ReadInt(&range)); 570 EXPECT_TRUE(iter.ReadInt(&range));
571 EXPECT_EQ(100, range); 571 EXPECT_EQ(100, range);
572 572
573 // No more data in the pickle. 573 // No more data in the pickle.
574 EXPECT_FALSE(iter.SkipBytes(1)); 574 EXPECT_FALSE(iter.SkipBytes(1));
575 } 575 }
576 576
577 TEST_P(HistogramTest, BadConstruction) { 577 TEST_P(HistogramTest, DISABLED_BadConstruction) {
578 HistogramBase* histogram = Histogram::FactoryGet( 578 HistogramBase* histogram = Histogram::FactoryGet(
579 "BadConstruction", 0, 100, 8, HistogramBase::kNoFlags); 579 "BadConstruction", 0, 100, 8, HistogramBase::kNoFlags);
580 EXPECT_TRUE(histogram->HasConstructionArguments(1, 100, 8)); 580 EXPECT_TRUE(histogram->HasConstructionArguments(1, 100, 8));
581 581
582 // Try to get the same histogram name with different arguments. 582 // Try to get the same histogram name with different arguments.
583 HistogramBase* bad_histogram = Histogram::FactoryGet( 583 HistogramBase* bad_histogram = Histogram::FactoryGet(
584 "BadConstruction", 0, 100, 7, HistogramBase::kNoFlags); 584 "BadConstruction", 0, 100, 7, HistogramBase::kNoFlags);
585 EXPECT_EQ(NULL, bad_histogram); 585 EXPECT_EQ(NULL, bad_histogram);
586 bad_histogram = Histogram::FactoryGet( 586 bad_histogram = Histogram::FactoryGet(
587 "BadConstruction", 0, 99, 8, HistogramBase::kNoFlags); 587 "BadConstruction", 0, 99, 8, HistogramBase::kNoFlags);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 // CustomHistogram needs at least 1 valid range. 703 // CustomHistogram needs at least 1 valid range.
704 custom_ranges.clear(); 704 custom_ranges.clear();
705 custom_ranges.push_back(0); 705 custom_ranges.push_back(0);
706 EXPECT_DEATH(CustomHistogram::FactoryGet("BadRangesCustom3", custom_ranges, 706 EXPECT_DEATH(CustomHistogram::FactoryGet("BadRangesCustom3", custom_ranges,
707 HistogramBase::kNoFlags), 707 HistogramBase::kNoFlags),
708 ""); 708 "");
709 } 709 }
710 #endif 710 #endif
711 711
712 } // namespace base 712 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/metrics/metrics_hashes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698