perfetto: further cleanup and consolidate test code

With the introduction of test helper, integration tests have already been made much cleaner.
Now the next step is to take this further and reduce coupling between producer
service and consumer. We can do this by making the producer emit data without
the test explicitly requesting it (like ftrace) if a flag in config is enabled.

Moreover, we can also consolidate all checkpointing code inside the helper class instead
of every file defining its own.

Bug: 74380167
Change-Id: Idbe24586a4aaadb17f934f6e06c5c6d378be0ec3
diff --git a/test/fake_producer.h b/test/fake_producer.h
index 35149e3..622ed94 100644
--- a/test/fake_producer.h
+++ b/test/fake_producer.h
@@ -41,7 +41,7 @@
 
   // Produces a batch of events (as configured in the DataSourceConfig) and
   // posts a callback when the service acknowledges the commit.
-  void ProduceEventBatch(std::function<void()> callback);
+  void ProduceEventBatch(std::function<void()> callback = [] {});
 
   // Producer implementation.
   void OnConnect() override;
@@ -59,7 +59,7 @@
   base::TaskRunner* task_runner_ = nullptr;
   std::string name_;
   std::minstd_rand0 rnd_engine_;
-  uint32_t message_size_ = 0;
+  uint64_t message_size_ = 0;
   uint32_t message_count_ = 0;
   uint32_t max_messages_per_second_ = 0;
   std::function<void()> on_create_data_source_instance_;