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

Side by Side Diff: content/browser/tracing/memory_tracing_browsertest.cc

Issue 1337943003: [tracing] Non-functional refactor of memory dump arg names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows test Created 5 years, 3 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
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/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "base/trace_event/memory_dump_manager.h" 9 #include "base/trace_event/memory_dump_manager.h"
10 #include "base/trace_event/memory_dump_provider.h" 10 #include "base/trace_event/memory_dump_provider.h"
(...skipping 20 matching lines...) Expand all
31 // creating memory dumps. 31 // creating memory dumps.
32 class MockDumpProvider : public base::trace_event::MemoryDumpProvider { 32 class MockDumpProvider : public base::trace_event::MemoryDumpProvider {
33 public: 33 public:
34 MOCK_METHOD2(OnMemoryDump, bool(const MemoryDumpArgs& args, 34 MOCK_METHOD2(OnMemoryDump, bool(const MemoryDumpArgs& args,
35 ProcessMemoryDump* pmd)); 35 ProcessMemoryDump* pmd));
36 }; 36 };
37 37
38 class MemoryTracingTest : public ContentBrowserTest { 38 class MemoryTracingTest : public ContentBrowserTest {
39 public: 39 public:
40 void DoRequestGlobalDump(const base::trace_event::MemoryDumpCallback& cb) { 40 void DoRequestGlobalDump(const base::trace_event::MemoryDumpCallback& cb) {
41 MemoryDumpArgs dump_args = { MemoryDumpArgs::LevelOfDetail::HIGH };
42 MemoryDumpManager::GetInstance()->RequestGlobalDump( 41 MemoryDumpManager::GetInstance()->RequestGlobalDump(
43 MemoryDumpType::EXPLICITLY_TRIGGERED, dump_args, cb); 42 MemoryDumpType::EXPLICITLY_TRIGGERED,
43 base::trace_event::MemoryDumpLevelOfDetail::DETAILED, cb);
44 } 44 }
45 45
46 // Used as callback argument for MemoryDumpManager::RequestGlobalDump(): 46 // Used as callback argument for MemoryDumpManager::RequestGlobalDump():
47 void OnGlobalMemoryDumpDone( 47 void OnGlobalMemoryDumpDone(
48 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 48 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
49 base::Closure closure, 49 base::Closure closure,
50 uint64 dump_guid, 50 uint64 dump_guid,
51 bool success) { 51 bool success) {
52 // Make sure we run the RunLoop closure on the same thread that originated 52 // Make sure we run the RunLoop closure on the same thread that originated
53 // the run loop (which is the IN_PROC_BROWSER_TEST_F main thread). 53 // the run loop (which is the IN_PROC_BROWSER_TEST_F main thread).
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 EnableMemoryTracing(); 214 EnableMemoryTracing();
215 RequestGlobalDumpAndWait(false /* from_renderer_thread */); 215 RequestGlobalDumpAndWait(false /* from_renderer_thread */);
216 EXPECT_EQ(1u, callback_call_count_); 216 EXPECT_EQ(1u, callback_call_count_);
217 EXPECT_NE(0u, last_callback_dump_guid_); 217 EXPECT_NE(0u, last_callback_dump_guid_);
218 EXPECT_TRUE(last_callback_success_); 218 EXPECT_TRUE(last_callback_success_);
219 DisableTracing(); 219 DisableTracing();
220 } 220 }
221 221
222 } // namespace content 222 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/tracing_handler.cc ('k') | content/child/web_memory_dump_provider_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698