OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/tracing/core/trace_buffer_writer.h" | 5 #include "components/tracing/core/trace_buffer_writer.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "components/tracing/core/trace_ring_buffer.h" | 9 #include "components/tracing/core/trace_ring_buffer.h" |
10 #include "components/tracing/test/golden_protos/events_chunk.pb.h" | 10 #include "components/tracing/proto/events_chunk.pb.h" |
Primiano Tucci (use gerrit)
2016/08/26 14:27:32
can we keep this in test/golden_protos? I feel it
| |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace tracing { | 13 namespace tracing { |
14 namespace v2 { | 14 namespace v2 { |
15 namespace { | 15 namespace { |
16 | 16 |
17 class MockEvent : public ::tracing::proto::Event { | 17 class MockEvent : public ::tracing::proto::Event { |
18 public: | 18 public: |
19 static TraceEventHandle Add(TraceBufferWriter* writer, size_t event_size) { | 19 static TraceEventHandle Add(TraceBufferWriter* writer, size_t event_size) { |
20 TraceEventHandle handle = writer->AddEvent(); | 20 TraceEventHandle handle = writer->AddEvent(); |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 // writer[3] did the last write before the bankrupcy and has one extra event. | 302 // writer[3] did the last write before the bankrupcy and has one extra event. |
303 ReadBackAndTestChunk(8, writer[3]->writer_id(), 1, 3, true, true); | 303 ReadBackAndTestChunk(8, writer[3]->writer_id(), 1, 3, true, true); |
304 | 304 |
305 // writer[4] overflew in the bankrupcy chunk and has 3 events as well. | 305 // writer[4] overflew in the bankrupcy chunk and has 3 events as well. |
306 ReadBackAndTestChunk(9, writer[4]->writer_id(), 1, 3, true, true); | 306 ReadBackAndTestChunk(9, writer[4]->writer_id(), 1, 3, true, true); |
307 } | 307 } |
308 | 308 |
309 } // namespace | 309 } // namespace |
310 } // namespace v2 | 310 } // namespace v2 |
311 } // namespace tracing | 311 } // namespace tracing |
OLD | NEW |