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 "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "base/trace_event/heap_profiler_allocation_context.h" | 6 #include "base/trace_event/heap_profiler_allocation_context.h" |
7 #include "base/trace_event/heap_profiler_stack_frame_deduplicator.h" | 7 #include "base/trace_event/heap_profiler_stack_frame_deduplicator.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/googletest/include/gtest/gtest.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
11 namespace trace_event { | 11 namespace trace_event { |
12 | 12 |
13 // Define all strings once, because the deduplicator requires pointer equality, | 13 // Define all strings once, because the deduplicator requires pointer equality, |
14 // and string interning is unreliable. | 14 // and string interning is unreliable. |
15 const char kBrowserMain[] = "BrowserMain"; | 15 const char kBrowserMain[] = "BrowserMain"; |
16 const char kRendererMain[] = "RendererMain"; | 16 const char kRendererMain[] = "RendererMain"; |
17 const char kCreateWidget[] = "CreateWidget"; | 17 const char kCreateWidget[] = "CreateWidget"; |
18 const char kInitialize[] = "Initialize"; | 18 const char kInitialize[] = "Initialize"; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // Inserting the same backtrace again should return the index of the existing | 114 // Inserting the same backtrace again should return the index of the existing |
115 // node. | 115 // node. |
116 ASSERT_EQ(1, dedup->Insert(bt0)); | 116 ASSERT_EQ(1, dedup->Insert(bt0)); |
117 ASSERT_EQ(2, dedup->Insert(bt1)); | 117 ASSERT_EQ(2, dedup->Insert(bt1)); |
118 ASSERT_EQ(dedup->begin() + 3, dedup->end()); | 118 ASSERT_EQ(dedup->begin() + 3, dedup->end()); |
119 } | 119 } |
120 | 120 |
121 } // namespace trace_event | 121 } // namespace trace_event |
122 } // namespace base | 122 } // namespace base |
OLD | NEW |