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

Unified Diff: base/metrics/histogram_unittest.cc

Issue 2162053006: Move EXPECT_DCHECK_DEATH from base/task_scheduler and use it in relevant base/ tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge up to r408965 Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/field_trial_unittest.cc ('k') | base/metrics/persistent_sample_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_unittest.cc
diff --git a/base/metrics/histogram_unittest.cc b/base/metrics/histogram_unittest.cc
index 5c2ca6883ae34f77bd011e5f1aa095f4d171174a..ccfe103c60bfb2cec4270141ba5e3f492b78338e 100644
--- a/base/metrics/histogram_unittest.cc
+++ b/base/metrics/histogram_unittest.cc
@@ -22,6 +22,7 @@
#include "base/metrics/statistics_recorder.h"
#include "base/pickle.h"
#include "base/strings/stringprintf.h"
+#include "base/test/gtest_util.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -701,7 +702,6 @@ TEST_P(HistogramTest, FactoryTime) {
<< "ns each.";
}
-#if GTEST_HAS_DEATH_TEST
// For Histogram, LinearHistogram and CustomHistogram, the minimum for a
// declared range is 1, while the maximum is (HistogramBase::kSampleType_MAX -
// 1). But we accept ranges exceeding those limits, and silently clamped to
@@ -735,17 +735,18 @@ TEST(HistogramDeathTest, BadRangesTest) {
// CustomHistogram does not accepts kSampleType_MAX as range.
custom_ranges.push_back(HistogramBase::kSampleType_MAX);
- EXPECT_DEATH(CustomHistogram::FactoryGet("BadRangesCustom2", custom_ranges,
- HistogramBase::kNoFlags),
- "");
+ EXPECT_DCHECK_DEATH(
+ CustomHistogram::FactoryGet("BadRangesCustom2", custom_ranges,
+ HistogramBase::kNoFlags),
+ "");
// CustomHistogram needs at least 1 valid range.
custom_ranges.clear();
custom_ranges.push_back(0);
- EXPECT_DEATH(CustomHistogram::FactoryGet("BadRangesCustom3", custom_ranges,
- HistogramBase::kNoFlags),
- "");
+ EXPECT_DCHECK_DEATH(
+ CustomHistogram::FactoryGet("BadRangesCustom3", custom_ranges,
+ HistogramBase::kNoFlags),
+ "");
}
-#endif
} // namespace base
« no previous file with comments | « base/metrics/field_trial_unittest.cc ('k') | base/metrics/persistent_sample_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698