OLD | NEW |
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/debug/trace_event_unittest.h" | 5 #include "base/debug/trace_event_unittest.h" |
6 | 6 |
7 #include <cstdlib> | 7 #include <cstdlib> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 const char* value); | 66 const char* value); |
67 bool FindNonMatchingValue(const char* key, | 67 bool FindNonMatchingValue(const char* key, |
68 const char* value); | 68 const char* value); |
69 void Clear() { | 69 void Clear() { |
70 trace_parsed_.Clear(); | 70 trace_parsed_.Clear(); |
71 json_output_.json_output.clear(); | 71 json_output_.json_output.clear(); |
72 } | 72 } |
73 | 73 |
74 void BeginTrace() { | 74 void BeginTrace() { |
75 event_watch_notification_ = 0; | 75 event_watch_notification_ = 0; |
76 TraceLog::GetInstance()->SetEnabled("*"); | 76 TraceLog::GetInstance()->SetEnabled(std::string("*")); |
77 } | 77 } |
78 | 78 |
79 void EndTraceAndFlush() { | 79 void EndTraceAndFlush() { |
80 while (TraceLog::GetInstance()->IsEnabled()) | 80 while (TraceLog::GetInstance()->IsEnabled()) |
81 TraceLog::GetInstance()->SetDisabled(); | 81 TraceLog::GetInstance()->SetDisabled(); |
82 TraceLog::GetInstance()->Flush( | 82 TraceLog::GetInstance()->Flush( |
83 base::Bind(&TraceEventTestFixture::OnTraceDataCollected, | 83 base::Bind(&TraceEventTestFixture::OnTraceDataCollected, |
84 base::Unretained(this))); | 84 base::Unretained(this))); |
85 } | 85 } |
86 | 86 |
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1473 trace_log->SetEnabled(std::string("moo")); | 1473 trace_log->SetEnabled(std::string("moo")); |
1474 EXPECT_TRUE(*trace_log->GetCategoryEnabled("baz")); | 1474 EXPECT_TRUE(*trace_log->GetCategoryEnabled("baz")); |
1475 EXPECT_TRUE(*trace_log->GetCategoryEnabled("moo")); | 1475 EXPECT_TRUE(*trace_log->GetCategoryEnabled("moo")); |
1476 EXPECT_TRUE(*trace_log->GetCategoryEnabled("foo")); | 1476 EXPECT_TRUE(*trace_log->GetCategoryEnabled("foo")); |
1477 trace_log->SetDisabled(); | 1477 trace_log->SetDisabled(); |
1478 trace_log->SetDisabled(); | 1478 trace_log->SetDisabled(); |
1479 } | 1479 } |
1480 | 1480 |
1481 } // namespace debug | 1481 } // namespace debug |
1482 } // namespace base | 1482 } // namespace base |
OLD | NEW |