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

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

Issue 2638763004: Report CHECK/DCHECK to test launcher summary output. (Closed)
Patch Set: Add test for assert handlers nesting. Created 3 years, 8 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/logging_unittest.cc ('k') | base/strings/string_piece.h » ('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/statistics_recorder.h" 5 #include "base/metrics/statistics_recorder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 11 matching lines...) Expand all
22 namespace { 22 namespace {
23 23
24 // Class to make sure any manipulations we do to the min log level are 24 // Class to make sure any manipulations we do to the min log level are
25 // contained (i.e., do not affect other unit tests). 25 // contained (i.e., do not affect other unit tests).
26 class LogStateSaver { 26 class LogStateSaver {
27 public: 27 public:
28 LogStateSaver() : old_min_log_level_(logging::GetMinLogLevel()) {} 28 LogStateSaver() : old_min_log_level_(logging::GetMinLogLevel()) {}
29 29
30 ~LogStateSaver() { 30 ~LogStateSaver() {
31 logging::SetMinLogLevel(old_min_log_level_); 31 logging::SetMinLogLevel(old_min_log_level_);
32 logging::SetLogAssertHandler(nullptr);
33 } 32 }
34 33
35 private: 34 private:
36 int old_min_log_level_; 35 int old_min_log_level_;
37 36
38 DISALLOW_COPY_AND_ASSIGN(LogStateSaver); 37 DISALLOW_COPY_AND_ASSIGN(LogStateSaver);
39 }; 38 };
40 39
41 } // namespace 40 } // namespace
42 41
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 histogram->Add(3); 720 histogram->Add(3);
722 histogram->Add(5); 721 histogram->Add(5);
723 StatisticsRecorder::ImportProvidedHistograms(); 722 StatisticsRecorder::ImportProvidedHistograms();
724 snapshot = found->SnapshotSamples(); 723 snapshot = found->SnapshotSamples();
725 EXPECT_EQ(3, snapshot->TotalCount()); 724 EXPECT_EQ(3, snapshot->TotalCount());
726 EXPECT_EQ(2, snapshot->GetCount(3)); 725 EXPECT_EQ(2, snapshot->GetCount(3));
727 EXPECT_EQ(1, snapshot->GetCount(5)); 726 EXPECT_EQ(1, snapshot->GetCount(5));
728 } 727 }
729 728
730 } // namespace base 729 } // namespace base
OLDNEW
« no previous file with comments | « base/logging_unittest.cc ('k') | base/strings/string_piece.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698