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

Unified Diff: src/platform/metrics/metrics_daemon.h

Issue 2049007: Start transition the metrics library to non-static API. Use gmock in tests. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: Break down tests to avoid explicit metrics lib mock checkpoints. Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/metrics/README ('k') | src/platform/metrics/metrics_daemon.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/metrics/metrics_daemon.h
diff --git a/src/platform/metrics/metrics_daemon.h b/src/platform/metrics/metrics_daemon.h
index 3ab857a9667662f92f1aecf5e3fa8f54134e44c3..3aeaaaaf9659fc39486196212a005ab78ea3d4f5 100644
--- a/src/platform/metrics/metrics_daemon.h
+++ b/src/platform/metrics/metrics_daemon.h
@@ -9,6 +9,8 @@
#include <glib.h>
#include <time.h>
+#include "metrics_library.h"
+
#include <gtest/gtest_prod.h> // for FRIEND_TEST
class MetricsDaemon {
@@ -34,18 +36,23 @@ class MetricsDaemon {
private:
friend class MetricsDaemonTest;
- FRIEND_TEST(MetricsDaemonTest, LogDailyUseRecord);
+ FRIEND_TEST(MetricsDaemonTest, LogDailyUseRecordBadFileLocation);
+ FRIEND_TEST(MetricsDaemonTest, LogDailyUseRecordOnLogin);
+ FRIEND_TEST(MetricsDaemonTest, LogDailyUseRecordRoundDown);
+ FRIEND_TEST(MetricsDaemonTest, LogDailyUseRecordRoundUp);
FRIEND_TEST(MetricsDaemonTest, LookupNetworkState);
FRIEND_TEST(MetricsDaemonTest, LookupPowerState);
FRIEND_TEST(MetricsDaemonTest, LookupScreenSaverState);
FRIEND_TEST(MetricsDaemonTest, LookupSessionState);
FRIEND_TEST(MetricsDaemonTest, MessageFilter);
- FRIEND_TEST(MetricsDaemonTest, NetStateChanged);
+ FRIEND_TEST(MetricsDaemonTest, NetStateChangedSimpleDrop);
+ FRIEND_TEST(MetricsDaemonTest, NetStateChangedSuspend);
FRIEND_TEST(MetricsDaemonTest, PowerStateChanged);
FRIEND_TEST(MetricsDaemonTest, PublishMetric);
FRIEND_TEST(MetricsDaemonTest, ScreenSaverStateChanged);
FRIEND_TEST(MetricsDaemonTest, SessionStateChanged);
- FRIEND_TEST(MetricsDaemonTest, SetUserActiveState);
+ FRIEND_TEST(MetricsDaemonTest, SetUserActiveStateSendOnLogin);
+ FRIEND_TEST(MetricsDaemonTest, SetUserActiveStateSendOnMonitor);
// The network states (see network_states.h).
enum NetworkState {
@@ -113,7 +120,7 @@ class MetricsDaemon {
static const char* kSessionStates_[kNumberSessionStates];
// Initializes.
- void Init(bool testing);
+ void Init(bool testing, MetricsLibraryInterface* metrics_lib);
// Creates the event loop and enters it.
void Loop();
@@ -190,6 +197,9 @@ class MetricsDaemon {
// Test mode.
bool testing_;
+ // The metrics library handle.
+ MetricsLibraryInterface* metrics_lib_;
+
const char* daily_use_record_file_;
// Current network state.
« no previous file with comments | « src/platform/metrics/README ('k') | src/platform/metrics/metrics_daemon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698