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

Side by Side Diff: components/tracing/core/trace_buffer_writer_unittest.cc

Issue 2281903002: Tracing V2: Trace buffer writer uses proto. (Closed)
Patch Set: more explicit Created 4 years, 3 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
OLDNEW
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/test/golden_tracing_protos/events_chunk.pb.h"
Primiano Tucci (use gerrit) 2016/08/26 15:15:13 probably a bit redundant as the outer folder is ca
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698