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

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

Issue 1165673002: [Startup Tracing] Hook up TraceConfig and remove CategoryFilter & TraceOptions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 | « base/trace_event/category_filter_unittest.cc ('k') | base/trace_event/trace_config.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/trace_event/memory_dump_manager.h" 5 #include "base/trace_event/memory_dump_manager.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 uint64 dump_guid, 57 uint64 dump_guid,
58 bool success) { 58 bool success) {
59 task_runner->PostTask(FROM_HERE, closure); 59 task_runner->PostTask(FROM_HERE, closure);
60 } 60 }
61 61
62 protected: 62 protected:
63 const char* kTraceCategory = MemoryDumpManager::kTraceCategoryForTesting; 63 const char* kTraceCategory = MemoryDumpManager::kTraceCategoryForTesting;
64 64
65 void EnableTracing(const char* category) { 65 void EnableTracing(const char* category) {
66 TraceLog::GetInstance()->SetEnabled( 66 TraceLog::GetInstance()->SetEnabled(
67 CategoryFilter(category), TraceLog::RECORDING_MODE, TraceOptions()); 67 TraceConfig(category, ""), TraceLog::RECORDING_MODE);
68 } 68 }
69 69
70 void DisableTracing() { TraceLog::GetInstance()->SetDisabled(); } 70 void DisableTracing() { TraceLog::GetInstance()->SetDisabled(); }
71 71
72 scoped_ptr<MemoryDumpManager> mdm_; 72 scoped_ptr<MemoryDumpManager> mdm_;
73 73
74 private: 74 private:
75 scoped_ptr<MessageLoop> message_loop_; 75 scoped_ptr<MessageLoop> message_loop_;
76 MemoryDumpManagerDelegateForTesting delegate_; 76 MemoryDumpManagerDelegateForTesting delegate_;
77 77
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 EXPECT_CALL(mdp1, OnMemoryDump(_)).Times(0); 268 EXPECT_CALL(mdp1, OnMemoryDump(_)).Times(0);
269 EXPECT_CALL(mdp2, OnMemoryDump(_)).Times(1).WillRepeatedly(Return(false)); 269 EXPECT_CALL(mdp2, OnMemoryDump(_)).Times(1).WillRepeatedly(Return(false));
270 mdm_->RequestGlobalDump(MemoryDumpType::EXPLICITLY_TRIGGERED); 270 mdm_->RequestGlobalDump(MemoryDumpType::EXPLICITLY_TRIGGERED);
271 271
272 DisableTracing(); 272 DisableTracing();
273 } 273 }
274 274
275 } // namespace trace_event 275 } // namespace trace_event
276 } // namespace base 276 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/category_filter_unittest.cc ('k') | base/trace_event/trace_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698