Merge "Fix include guards and add PRESUBMIT"
diff --git a/test/end_to_end_integrationtest.cc b/test/end_to_end_integrationtest.cc
index cedef6c..a8b66cc 100644
--- a/test/end_to_end_integrationtest.cc
+++ b/test/end_to_end_integrationtest.cc
@@ -116,8 +116,14 @@
};
};
-// TODO(b/73453011): reenable this when fixed.
-TEST_F(PerfettoTest, DISABLED_TestFtraceProducer) {
+// TODO(b/73453011): reenable this on more platforms (including standalone
+// Android).
+#if defined(PERFETTO_BUILD_WITH_ANDROID)
+#define MAYBE_TestFtraceProducer TestFtraceProducer
+#else
+#define MAYBE_TestFtraceProducer DISABLED_TestFtraceProducer
+#endif
+TEST_F(PerfettoTest, MAYBE_TestFtraceProducer) {
base::TestTaskRunner task_runner;
auto finish = task_runner.CreateCheckpoint("no.more.packets");
diff --git a/test/end_to_end_shared_memory_fuzzer.cc b/test/end_to_end_shared_memory_fuzzer.cc
index 22902d3..e3b645c 100644
--- a/test/end_to_end_shared_memory_fuzzer.cc
+++ b/test/end_to_end_shared_memory_fuzzer.cc
@@ -35,12 +35,12 @@
#include "test/fake_consumer.h"
#include "test/task_runner_thread.h"
-#define PRODUCER_SOCKET "/tmp/perfetto-producer"
-#define CONSUMER_SOCKET "/tmp/perfetto-consumer"
-
namespace perfetto {
namespace shm_fuzz {
+static const char* kProducerSocket = tempnam("/tmp", "perfetto-producer");
+static const char* kConsumerSocket = tempnam("/tmp", "perfetto-consumer");
+
// Fake producer writing a protozero message of data into shared memory
// buffer, followed by a sentinel message to signal completion to the
// consumer.
@@ -101,7 +101,7 @@
void Initialize(base::TaskRunner* task_runner) override {
producer_.reset(new FakeProducer("android.perfetto.FakeProducer", data_,
size_, consumer_));
- producer_->Connect(PRODUCER_SOCKET, task_runner);
+ producer_->Connect(kProducerSocket, task_runner);
}
private:
@@ -117,9 +117,9 @@
~ServiceDelegate() override = default;
void Initialize(base::TaskRunner* task_runner) override {
svc_ = ServiceIPCHost::CreateInstance(task_runner);
- unlink(PRODUCER_SOCKET);
- unlink(CONSUMER_SOCKET);
- svc_->Start(PRODUCER_SOCKET, CONSUMER_SOCKET);
+ unlink(kProducerSocket);
+ unlink(kConsumerSocket);
+ svc_->Start(kProducerSocket, kConsumerSocket);
}
private:
@@ -155,7 +155,7 @@
}
};
FakeConsumer consumer(trace_config, std::move(function), &task_runner);
- consumer.Connect(CONSUMER_SOCKET);
+ consumer.Connect(kConsumerSocket);
TaskRunnerThread producer_thread;
producer_thread.Start(std::unique_ptr<FakeProducerDelegate>(