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

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

Issue 1308403002: [Tracing] Disable registration of regular dump providers during tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@reland-content-browsertest
Patch Set: Fix indentation Created 5 years, 2 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/memory_dump_manager_unittest.cc ('k') | 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 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 protected: 67 protected:
68 void SetUp() override { 68 void SetUp() override {
69 callback_call_count_ = 0; 69 callback_call_count_ = 0;
70 last_callback_dump_guid_ = 0; 70 last_callback_dump_guid_ = 0;
71 last_callback_success_ = false; 71 last_callback_success_ = false;
72 72
73 mock_dump_provider_.reset(new MockDumpProvider()); 73 mock_dump_provider_.reset(new MockDumpProvider());
74 MemoryDumpManager::GetInstance()->RegisterDumpProvider( 74 MemoryDumpManager::GetInstance()->RegisterDumpProvider(
75 mock_dump_provider_.get()); 75 mock_dump_provider_.get());
76 MemoryDumpManager::GetInstance()
77 ->set_dumper_registrations_ignored_for_testing(false);
76 ContentBrowserTest::SetUp(); 78 ContentBrowserTest::SetUp();
77 } 79 }
78 80
79 void TearDown() override { 81 void TearDown() override {
80 MemoryDumpManager::GetInstance()->UnregisterDumpProvider( 82 MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
81 mock_dump_provider_.get()); 83 mock_dump_provider_.get());
82 mock_dump_provider_.reset(); 84 mock_dump_provider_.reset();
83 ContentBrowserTest::TearDown(); 85 ContentBrowserTest::TearDown();
84 } 86 }
85 87
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 215
214 EnableMemoryTracing(); 216 EnableMemoryTracing();
215 RequestGlobalDumpAndWait(false /* from_renderer_thread */); 217 RequestGlobalDumpAndWait(false /* from_renderer_thread */);
216 EXPECT_EQ(1u, callback_call_count_); 218 EXPECT_EQ(1u, callback_call_count_);
217 EXPECT_NE(0u, last_callback_dump_guid_); 219 EXPECT_NE(0u, last_callback_dump_guid_);
218 EXPECT_TRUE(last_callback_success_); 220 EXPECT_TRUE(last_callback_success_);
219 DisableTracing(); 221 DisableTracing();
220 } 222 }
221 223
222 } // namespace content 224 } // namespace content
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698