OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/guid.h" | 10 #include "base/guid.h" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "base/strings/stringprintf.h" | |
13 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
14 #include "base/test/test_reg_util_win.h" | 13 #include "base/test/test_reg_util_win.h" |
15 #include "base/time/time.h" | 14 #include "base/time/time.h" |
16 #include "base/win/registry.h" | 15 #include "base/win/registry.h" |
17 #include "chrome/installer/gcapi/gcapi.h" | 16 #include "chrome/installer/gcapi/gcapi.h" |
18 #include "chrome/installer/util/google_update_constants.h" | 17 #include "chrome/installer/util/google_update_constants.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
20 | 19 |
21 using base::Time; | 20 using base::Time; |
22 using base::TimeDelta; | 21 using base::TimeDelta; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 EXPECT_EQ(-1, days_since_last_run); | 90 EXPECT_EQ(-1, days_since_last_run); |
92 } | 91 } |
93 | 92 |
94 TEST_F(GCAPILastRunTest, OutOfRangeLastRun) { | 93 TEST_F(GCAPILastRunTest, OutOfRangeLastRun) { |
95 Time last_run = Time::NowFromSystemTime() - TimeDelta::FromDays(-42); | 94 Time last_run = Time::NowFromSystemTime() - TimeDelta::FromDays(-42); |
96 EXPECT_TRUE(SetLastRunTime(last_run.ToInternalValue())); | 95 EXPECT_TRUE(SetLastRunTime(last_run.ToInternalValue())); |
97 | 96 |
98 int days_since_last_run = GoogleChromeDaysSinceLastRun(); | 97 int days_since_last_run = GoogleChromeDaysSinceLastRun(); |
99 EXPECT_EQ(-1, days_since_last_run); | 98 EXPECT_EQ(-1, days_since_last_run); |
100 } | 99 } |
OLD | NEW |