| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |