summaryrefslogtreecommitdiffstats
path: root/chrome/browser/google_update_settings_unittest.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-07-29 17:14:53 +0100
committerBen Murdoch <benm@google.com>2010-08-04 14:29:45 +0100
commitc407dc5cd9bdc5668497f21b26b09d988ab439de (patch)
tree7eaf8707c0309516bdb042ad976feedaf72b0bb1 /chrome/browser/google_update_settings_unittest.cc
parent0998b1cdac5733f299c12d88bc31ef9c8035b8fa (diff)
downloadexternal_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.zip
external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.gz
external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.bz2
Merge Chromium src@r53293
Change-Id: Ia79acf8670f385cee48c45b0a75371d8e950af34
Diffstat (limited to 'chrome/browser/google_update_settings_unittest.cc')
-rw-r--r--chrome/browser/google_update_settings_unittest.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/chrome/browser/google_update_settings_unittest.cc b/chrome/browser/google_update_settings_unittest.cc
new file mode 100644
index 0000000..8dc56bb
--- /dev/null
+++ b/chrome/browser/google_update_settings_unittest.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2009 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.
+
+#include "chrome/installer/util/google_update_settings.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/platform_test.h"
+
+class GoogleUpdateTest : public PlatformTest {
+};
+
+TEST_F(GoogleUpdateTest, StatsConstent) {
+ // Stats are off by default.
+ EXPECT_FALSE(GoogleUpdateSettings::GetCollectStatsConsent());
+ // Stats reporting is ON.
+ EXPECT_TRUE(GoogleUpdateSettings::SetCollectStatsConsent(true));
+ EXPECT_TRUE(GoogleUpdateSettings::GetCollectStatsConsent());
+ // Stats reporting is OFF.
+ EXPECT_TRUE(GoogleUpdateSettings::SetCollectStatsConsent(false));
+ EXPECT_FALSE(GoogleUpdateSettings::GetCollectStatsConsent());
+}
+
+#if defined(OS_WIN)
+
+TEST_F(GoogleUpdateTest, LastRunTime) {
+ // Querying the value that does not exists should fail.
+ EXPECT_TRUE(GoogleUpdateSettings::RemoveLastRunTime());
+ EXPECT_EQ(-1, GoogleUpdateSettings::GetLastRunTime());
+ // Setting and querying the last update time in fast sequence
+ // should give 0 days.
+ EXPECT_TRUE(GoogleUpdateSettings::SetLastRunTime());
+ EXPECT_EQ(0, GoogleUpdateSettings::GetLastRunTime());
+}
+
+#endif // defined(OS_WIN)