Index: components/feature_engagement_tracker/internal/test/event_util.h |
diff --git a/components/feature_engagement_tracker/internal/test/event_util.h b/components/feature_engagement_tracker/internal/test/event_util.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..872f68a0ce844c2e334ae4cf88a172fa0adb2ea8 |
--- /dev/null |
+++ b/components/feature_engagement_tracker/internal/test/event_util.h |
@@ -0,0 +1,26 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_TEST_EVENT_UTIL_H_ |
+#define COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_TEST_EVENT_UTIL_H_ |
+ |
+#include "components/feature_engagement_tracker/internal/proto/event.pb.h" |
nyquist
2017/05/11 17:08:03
Nit: Could you forward declare Event instead?
David Trainor- moved to gerrit
2017/05/11 19:30:28
Done.
|
+ |
+namespace feature_engagement_tracker { |
+namespace test { |
+ |
+// Adds an Event count entry for |event|. |
+void SetEventCountForDay(Event* event, uint32_t day, uint32_t count); |
nyquist
2017/05/11 17:08:03
Nit: Missing #include "<stdint.h>"
David Trainor- moved to gerrit
2017/05/11 19:30:28
Done.
|
+ |
+// Verifies that the given |event| contains a |day| with the correct |count|, |
+// and that the day only exists a single time. |
+void VerifyEventCount(const Event* event, uint32_t day, uint32_t count); |
+ |
+// Verifies that the event |a| and |b| contain the exact same data. |
+void VerifyEventsEqual(const Event* a, const Event* b); |
+ |
+} // namespace test |
+} // namespace feature_engagement_tracker |
+ |
+#endif // COMPONENTS_FEATURE_ENGAGEMENT_TRACKER_INTERNAL_TEST_EVENT_UTIL_H_ |