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

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

Issue 1559023002: [tracing] Make memory-infra unregristration DCHECK stricter Base URL: https://chromium.googlesource.com/chromium/src.git@mdm_delete_async
Patch Set: +browsertests Created 4 years, 11 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 | « components/tracing/child_trace_message_filter_browsertest.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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 68
69 protected: 69 protected:
70 void SetUp() override { 70 void SetUp() override {
71 callback_call_count_ = 0; 71 callback_call_count_ = 0;
72 last_callback_dump_guid_ = 0; 72 last_callback_dump_guid_ = 0;
73 last_callback_success_ = false; 73 last_callback_success_ = false;
74 74
75 mock_dump_provider_.reset(new MockDumpProvider()); 75 mock_dump_provider_.reset(new MockDumpProvider());
76 MemoryDumpManager::GetInstance()->RegisterDumpProvider( 76 MemoryDumpManager::GetInstance()->RegisterDumpProvider(
77 mock_dump_provider_.get(), "MockDumpProvider", nullptr); 77 mock_dump_provider_.get(), "MockDumpProvider",
78 base::ThreadTaskRunnerHandle::Get());
78 MemoryDumpManager::GetInstance() 79 MemoryDumpManager::GetInstance()
79 ->set_dumper_registrations_ignored_for_testing(false); 80 ->set_dumper_registrations_ignored_for_testing(false);
80 ContentBrowserTest::SetUp(); 81 ContentBrowserTest::SetUp();
81 } 82 }
82 83
83 void TearDown() override { 84 void TearDown() override {
84 MemoryDumpManager::GetInstance()->UnregisterDumpProvider( 85 MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
85 mock_dump_provider_.get()); 86 mock_dump_provider_.get());
86 mock_dump_provider_.reset(); 87 mock_dump_provider_.reset();
87 ContentBrowserTest::TearDown(); 88 ContentBrowserTest::TearDown();
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 224
224 EnableMemoryTracing(); 225 EnableMemoryTracing();
225 RequestGlobalDumpAndWait(false /* from_renderer_thread */); 226 RequestGlobalDumpAndWait(false /* from_renderer_thread */);
226 EXPECT_EQ(1u, callback_call_count_); 227 EXPECT_EQ(1u, callback_call_count_);
227 EXPECT_NE(0u, last_callback_dump_guid_); 228 EXPECT_NE(0u, last_callback_dump_guid_);
228 EXPECT_TRUE(last_callback_success_); 229 EXPECT_TRUE(last_callback_success_);
229 DisableTracing(); 230 DisableTracing();
230 } 231 }
231 232
232 } // namespace content 233 } // namespace content
OLDNEW
« no previous file with comments | « components/tracing/child_trace_message_filter_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698