| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "mojo/edk/system/handle_table.h" | 5 #include "mojo/edk/system/handle_table.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
| 10 #include "base/trace_event/memory_allocator_dump.h" | 10 #include "base/trace_event/memory_allocator_dump.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 TEST(HandleTableTest, OnMemoryDump) { | 57 TEST(HandleTableTest, OnMemoryDump) { |
| 58 HandleTable ht; | 58 HandleTable ht; |
| 59 | 59 |
| 60 { | 60 { |
| 61 base::AutoLock auto_lock(ht.GetLock()); | 61 base::AutoLock auto_lock(ht.GetLock()); |
| 62 scoped_refptr<mojo::edk::Dispatcher> dispatcher( | 62 scoped_refptr<mojo::edk::Dispatcher> dispatcher( |
| 63 new FakeMessagePipeDispatcher); | 63 new FakeMessagePipeDispatcher); |
| 64 ht.AddDispatcher(dispatcher); | 64 ht.AddDispatcher(dispatcher); |
| 65 } | 65 } |
| 66 | 66 |
| 67 base::trace_event::MemoryDumpArgs args; | 67 base::trace_event::MemoryDumpArgs args = { |
| 68 base::trace_event::MemoryDumpLevelOfDetail::DETAILED}; |
| 68 base::trace_event::ProcessMemoryDump pmd(nullptr, args); | 69 base::trace_event::ProcessMemoryDump pmd(nullptr, args); |
| 69 ht.OnMemoryDump(args, &pmd); | 70 ht.OnMemoryDump(args, &pmd); |
| 70 | 71 |
| 71 CheckNameAndValue(&pmd, "mojo/message_pipe", "1"); | 72 CheckNameAndValue(&pmd, "mojo/message_pipe", "1"); |
| 72 CheckNameAndValue(&pmd, "mojo/data_pipe_consumer", "0"); | 73 CheckNameAndValue(&pmd, "mojo/data_pipe_consumer", "0"); |
| 73 } | 74 } |
| 74 | 75 |
| 75 } // namespace edk | 76 } // namespace edk |
| 76 } // namespace mojo | 77 } // namespace mojo |
| OLD | NEW |