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

Unified Diff: src/platform/metrics/metrics_daemon_test.cc

Issue 2079007: Add metrics library tests. Some metrics daemon API cleanup. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: A bit more cleanup. 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/metrics_daemon_main.cc ('k') | src/platform/metrics/metrics_library.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/metrics/metrics_daemon_test.cc
diff --git a/src/platform/metrics/metrics_daemon_test.cc b/src/platform/metrics/metrics_daemon_test.cc
index 8180b143caa00058dbb0154ff8d2508665f8f7a8..2edbeda9e807cd76af83ebc9b7b7c88fe59a6c34 100644
--- a/src/platform/metrics/metrics_daemon_test.cc
+++ b/src/platform/metrics/metrics_daemon_test.cc
@@ -25,7 +25,9 @@ static const int kSecondsPerDay = 24 * 60 * 60;
class MetricsDaemonTest : public testing::Test {
protected:
virtual void SetUp() {
+ EXPECT_EQ(NULL, daemon_.daily_use_record_file_);
daemon_.Init(true, &metrics_lib_);
+ EXPECT_TRUE(NULL != daemon_.daily_use_record_file_);
daemon_.daily_use_record_file_ = kTestDailyUseRecordFile;
// The test fixture object will be used by the log message handler.
@@ -423,12 +425,6 @@ TEST_F(MetricsDaemonTest, PowerStateChanged) {
EXPECT_PRED_FORMAT2(AssertDailyUseRecord, /* day */ 7, /* seconds */ 30);
}
-TEST_F(MetricsDaemonTest, PublishMetric) {
- ExpectMetric("Dummy.Metric", 3, 1, 100, 50);
- daemon_.PublishMetric("Dummy.Metric", /* sample */ 3,
- /* min */ 1, /* max */ 100, /* buckets */ 50);
-}
-
TEST_F(MetricsDaemonTest, ScreenSaverStateChanged) {
EXPECT_EQ(MetricsDaemon::kUnknownScreenSaverState,
daemon_.screensaver_state_);
@@ -460,6 +456,12 @@ TEST_F(MetricsDaemonTest, ScreenSaverStateChanged) {
EXPECT_PRED_FORMAT2(AssertDailyUseRecord, /* day */ 5, /* seconds */ 200);
}
+TEST_F(MetricsDaemonTest, SendMetric) {
+ ExpectMetric("Dummy.Metric", 3, 1, 100, 50);
+ daemon_.SendMetric("Dummy.Metric", /* sample */ 3,
+ /* min */ 1, /* max */ 100, /* buckets */ 50);
+}
+
TEST_F(MetricsDaemonTest, SessionStateChanged) {
EXPECT_EQ(MetricsDaemon::kUnknownSessionState, daemon_.session_state_);
EXPECT_FALSE(daemon_.user_active_);
« no previous file with comments | « src/platform/metrics/metrics_daemon_main.cc ('k') | src/platform/metrics/metrics_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698