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

Side by Side Diff: base/trace_event/trace_event_unittest.cc

Issue 1187963005: Initialize num_flush_callbacks_ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | no next file » | 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 <math.h> 5 #include <math.h>
6 #include <cstdlib> 6 #include <cstdlib>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 void SetUp() override { 130 void SetUp() override {
131 const char* name = PlatformThread::GetName(); 131 const char* name = PlatformThread::GetName();
132 old_thread_name_ = name ? strdup(name) : NULL; 132 old_thread_name_ = name ? strdup(name) : NULL;
133 133
134 TraceLog::DeleteForTesting(); 134 TraceLog::DeleteForTesting();
135 TraceLog* tracelog = TraceLog::GetInstance(); 135 TraceLog* tracelog = TraceLog::GetInstance();
136 ASSERT_TRUE(tracelog); 136 ASSERT_TRUE(tracelog);
137 ASSERT_FALSE(tracelog->IsEnabled()); 137 ASSERT_FALSE(tracelog->IsEnabled());
138 trace_buffer_.SetOutputCallback(json_output_.GetCallback()); 138 trace_buffer_.SetOutputCallback(json_output_.GetCallback());
139 event_watch_notification_ = 0; 139 event_watch_notification_ = 0;
140 num_flush_callbacks_ = 0;
140 } 141 }
141 void TearDown() override { 142 void TearDown() override {
142 if (TraceLog::GetInstance()) 143 if (TraceLog::GetInstance())
143 EXPECT_FALSE(TraceLog::GetInstance()->IsEnabled()); 144 EXPECT_FALSE(TraceLog::GetInstance()->IsEnabled());
144 PlatformThread::SetName(old_thread_name_ ? old_thread_name_ : ""); 145 PlatformThread::SetName(old_thread_name_ ? old_thread_name_ : "");
145 free(old_thread_name_); 146 free(old_thread_name_);
146 old_thread_name_ = NULL; 147 old_thread_name_ = NULL;
147 // We want our singleton torn down after each test. 148 // We want our singleton torn down after each test.
148 TraceLog::DeleteForTesting(); 149 TraceLog::DeleteForTesting();
149 } 150 }
(...skipping 2781 matching lines...) Expand 10 before | Expand all | Expand 10 after
2931 } 2932 }
2932 2933
2933 TEST_F(TraceEventTestFixture, SyntheticDelayConfigurationToString) { 2934 TEST_F(TraceEventTestFixture, SyntheticDelayConfigurationToString) {
2934 const char filter[] = "DELAY(test.Delay;16;oneshot)"; 2935 const char filter[] = "DELAY(test.Delay;16;oneshot)";
2935 TraceConfig config(filter, ""); 2936 TraceConfig config(filter, "");
2936 EXPECT_EQ(filter, config.ToCategoryFilterString()); 2937 EXPECT_EQ(filter, config.ToCategoryFilterString());
2937 } 2938 }
2938 2939
2939 } // namespace trace_event 2940 } // namespace trace_event
2940 } // namespace base 2941 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698