metricsd: Fix unit tests.
When logging, libchrome will extract the program's name from the command
line. If the command line helpers have not been initialized, the logging
call will fail and the program will abort.
BUG: 24262190
TEST: unit tests.
Change-Id: Ie7982d5491f8373dc06ba44b69b518ff8673b568
diff --git a/metricsd/metrics_daemon_test.cc b/metricsd/metrics_daemon_test.cc
index 476d0f3..1adf9de 100644
--- a/metricsd/metrics_daemon_test.cc
+++ b/metricsd/metrics_daemon_test.cc
@@ -25,6 +25,7 @@
#include <base/files/scoped_temp_dir.h>
#include <base/strings/string_number_conversions.h>
#include <base/strings/stringprintf.h>
+#include <chromeos/flag_helper.h>
#include <gtest/gtest.h>
#include "constants.h"
@@ -60,6 +61,7 @@
std::string kFakeDiskStats1;
virtual void SetUp() {
+ chromeos::FlagHelper::Init(0, nullptr, "");
EXPECT_TRUE(temp_dir_.CreateUniqueTempDir());
scaling_max_freq_path_ = temp_dir_.path().Append("scaling_max");
cpu_max_freq_path_ = temp_dir_.path().Append("cpu_freq_max");