diff options
author | shinyak@google.com <shinyak@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-26 18:17:03 +0000 |
---|---|---|
committer | shinyak@google.com <shinyak@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-26 18:17:03 +0000 |
commit | 5086cfc86ff0050abbf63972bd70cbc48d5e7f57 (patch) | |
tree | 98855082b195a1a0648475a57d7ba3778ff14f20 /base | |
parent | a60865a91102be0b19d826fb9d26f0bc98066ca6 (diff) | |
download | chromium_src-5086cfc86ff0050abbf63972bd70cbc48d5e7f57.zip chromium_src-5086cfc86ff0050abbf63972bd70cbc48d5e7f57.tar.gz chromium_src-5086cfc86ff0050abbf63972bd70cbc48d5e7f57.tar.bz2 |
Removed wchar_t from Time::FromString.
Also, some of the test case are moved from pr_time_unittests to time_unittests.
BUG=77962
TEST=base_unittests:TimeTest.*
Review URL: http://codereview.chromium.org/6903022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83048 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/file_util_unittest.cc | 4 | ||||
-rw-r--r-- | base/metrics/field_trial.cc | 3 | ||||
-rw-r--r-- | base/pr_time_unittest.cc | 146 | ||||
-rw-r--r-- | base/third_party/nspr/prtime.h | 2 | ||||
-rw-r--r-- | base/time.cc | 13 | ||||
-rw-r--r-- | base/time.h | 2 | ||||
-rw-r--r-- | base/time_unittest.cc | 246 |
7 files changed, 253 insertions, 163 deletions
diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc index 733f9f1..db9d638 100644 --- a/base/file_util_unittest.cc +++ b/base/file_util_unittest.cc @@ -1779,13 +1779,13 @@ TEST_F(FileUtilTest, TouchFile) { base::Time access_time; // This timestamp is divisible by one day (in local timezone), // to make it work on FAT too. - ASSERT_TRUE(base::Time::FromString(L"Wed, 16 Nov 1994, 00:00:00", + ASSERT_TRUE(base::Time::FromString("Wed, 16 Nov 1994, 00:00:00", &access_time)); base::Time modification_time; // Note that this timestamp is divisible by two (seconds) - FAT stores // modification times with 2s resolution. - ASSERT_TRUE(base::Time::FromString(L"Tue, 15 Nov 1994, 12:45:26 GMT", + ASSERT_TRUE(base::Time::FromString("Tue, 15 Nov 1994, 12:45:26 GMT", &modification_time)); ASSERT_TRUE(file_util::TouchFile(foobar, access_time, modification_time)); diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc index ad2e5a0..76fc6f6 100644 --- a/base/metrics/field_trial.cc +++ b/base/metrics/field_trial.cc @@ -121,8 +121,7 @@ FieldTrial::~FieldTrial() {} Time FieldTrial::GetBuildTime() { Time integral_build_time; const char* kDateTime = __DATE__ " " __TIME__; - bool result = Time::FromString(ASCIIToWide(kDateTime).c_str(), - &integral_build_time); + bool result = Time::FromString(kDateTime, &integral_build_time); DCHECK(result); return integral_build_time; } diff --git a/base/pr_time_unittest.cc b/base/pr_time_unittest.cc index 646eb16..12521a4 100644 --- a/base/pr_time_unittest.cc +++ b/base/pr_time_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -132,149 +132,5 @@ TEST_F(PRTimeTest, ParseTimeTest9) { EXPECT_EQ(parsed_time, comparison_time_pdt); } -// This tests the Time::FromString wrapper over PR_ParseTimeString -TEST_F(PRTimeTest, ParseTimeTest10) { - Time parsed_time; - bool result = Time::FromString(L"15/10/07 12:45", &parsed_time); - EXPECT_TRUE(result); - - time_t computed_time = parsed_time.ToTimeT(); - time_t time_to_compare = comparison_time_local_ / - Time::kMicrosecondsPerSecond; - EXPECT_EQ(computed_time, time_to_compare); -} - -// This tests the Time::FromString wrapper over PR_ParseTimeString -TEST_F(PRTimeTest, ParseTimeTest11) { - Time parsed_time; - bool result = Time::FromString(L"Mon, 15 Oct 2007 19:45:00 GMT", - &parsed_time); - EXPECT_TRUE(result); - - time_t computed_time = parsed_time.ToTimeT(); - time_t time_to_compare = comparison_time_pdt / Time::kMicrosecondsPerSecond; - EXPECT_EQ(computed_time, time_to_compare); -} - -// Test some of edge cases around epoch, etc. -TEST_F(PRTimeTest, ParseTimeTestEpoch0) { - Time parsed_time; - - // time_t == epoch == 0 - EXPECT_TRUE(Time::FromString(L"Thu Jan 01 01:00:00 +0100 1970", - &parsed_time)); - EXPECT_EQ(0, parsed_time.ToTimeT()); - EXPECT_TRUE(Time::FromString(L"Thu Jan 01 00:00:00 GMT 1970", - &parsed_time)); - EXPECT_EQ(0, parsed_time.ToTimeT()); -} - -TEST_F(PRTimeTest, ParseTimeTestEpoch1) { - Time parsed_time; - - // time_t == 1 second after epoch == 1 - EXPECT_TRUE(Time::FromString(L"Thu Jan 01 01:00:01 +0100 1970", - &parsed_time)); - EXPECT_EQ(1, parsed_time.ToTimeT()); - EXPECT_TRUE(Time::FromString(L"Thu Jan 01 00:00:01 GMT 1970", - &parsed_time)); - EXPECT_EQ(1, parsed_time.ToTimeT()); -} - -TEST_F(PRTimeTest, ParseTimeTestEpoch2) { - Time parsed_time; - - // time_t == 2 seconds after epoch == 2 - EXPECT_TRUE(Time::FromString(L"Thu Jan 01 01:00:02 +0100 1970", - &parsed_time)); - EXPECT_EQ(2, parsed_time.ToTimeT()); - EXPECT_TRUE(Time::FromString(L"Thu Jan 01 00:00:02 GMT 1970", - &parsed_time)); - EXPECT_EQ(2, parsed_time.ToTimeT()); -} - -TEST_F(PRTimeTest, ParseTimeTestEpochNeg1) { - Time parsed_time; - - // time_t == 1 second before epoch == -1 - EXPECT_TRUE(Time::FromString(L"Thu Jan 01 00:59:59 +0100 1970", - &parsed_time)); - EXPECT_EQ(-1, parsed_time.ToTimeT()); - EXPECT_TRUE(Time::FromString(L"Wed Dec 31 23:59:59 GMT 1969", - &parsed_time)); - EXPECT_EQ(-1, parsed_time.ToTimeT()); -} - -// If time_t is 32 bits, a date after year 2038 will overflow time_t and -// cause timegm() to return -1. The parsed time should not be 1 second -// before epoch. -TEST_F(PRTimeTest, ParseTimeTestEpochNotNeg1) { - Time parsed_time; - - EXPECT_TRUE(Time::FromString(L"Wed Dec 31 23:59:59 GMT 2100", - &parsed_time)); - EXPECT_NE(-1, parsed_time.ToTimeT()); -} - -TEST_F(PRTimeTest, ParseTimeTestEpochNeg2) { - Time parsed_time; - - // time_t == 2 seconds before epoch == -2 - EXPECT_TRUE(Time::FromString(L"Thu Jan 01 00:59:58 +0100 1970", - &parsed_time)); - EXPECT_EQ(-2, parsed_time.ToTimeT()); - EXPECT_TRUE(Time::FromString(L"Wed Dec 31 23:59:58 GMT 1969", - &parsed_time)); - EXPECT_EQ(-2, parsed_time.ToTimeT()); -} - -TEST_F(PRTimeTest, ParseTimeTestEpoch1960) { - Time parsed_time; - - // time_t before Epoch, in 1960 - EXPECT_TRUE(Time::FromString(L"Wed Jun 29 19:40:01 +0100 1960", - &parsed_time)); - EXPECT_EQ(-299999999, parsed_time.ToTimeT()); - EXPECT_TRUE(Time::FromString(L"Wed Jun 29 18:40:01 GMT 1960", - &parsed_time)); - EXPECT_EQ(-299999999, parsed_time.ToTimeT()); - EXPECT_TRUE(Time::FromString(L"Wed Jun 29 17:40:01 GMT 1960", - &parsed_time)); - EXPECT_EQ(-300003599, parsed_time.ToTimeT()); -} - -TEST_F(PRTimeTest, ParseTimeTestEmpty) { - Time parsed_time; - EXPECT_FALSE(Time::FromString(L"", &parsed_time)); -} - -// This test should not crash when compiled with Visual C++ 2005 (see -// http://crbug.com/4387). -TEST_F(PRTimeTest, ParseTimeTestOutOfRange) { - PRTime parsed_time = 0; - // Note the lack of timezone in the time string. The year has to be 3001. - // The date has to be after 23:59:59, December 31, 3000, US Pacific Time, so - // we use January 2, 3001 to make sure it's after the magic maximum in any - // timezone. - PRStatus result = PR_ParseTimeString("Sun Jan 2 00:00:00 3001", - PR_FALSE, &parsed_time); - EXPECT_EQ(PR_SUCCESS, result); -} - -TEST_F(PRTimeTest, ParseTimeTestNotNormalized1) { - PRTime parsed_time = 0; - PRStatus result = PR_ParseTimeString("Mon Oct 15 12:44:60 PDT 2007", - PR_FALSE, &parsed_time); - EXPECT_EQ(PR_SUCCESS, result); - EXPECT_EQ(comparison_time_pdt, parsed_time); -} - -TEST_F(PRTimeTest, ParseTimeTestNotNormalized2) { - PRTime parsed_time = 0; - PRStatus result = PR_ParseTimeString("Sun Oct 14 36:45 PDT 2007", - PR_FALSE, &parsed_time); - EXPECT_EQ(PR_SUCCESS, result); - EXPECT_EQ(comparison_time_pdt, parsed_time); -} } // namespace diff --git a/base/third_party/nspr/prtime.h b/base/third_party/nspr/prtime.h index a207021..be94794 100644 --- a/base/third_party/nspr/prtime.h +++ b/base/third_party/nspr/prtime.h @@ -230,7 +230,7 @@ NSPR_API(PRTimeParameters) PR_GMTParameters(const PRExplodedTime *gmt); * from the unit test. */ -BASE_API PRStatus PR_ParseTimeString ( +NSPR_API(PRStatus) PR_ParseTimeString ( const char *string, PRBool default_to_gmt, PRTime *result); diff --git a/base/time.cc b/base/time.cc index 766f599..94b560a 100644 --- a/base/time.cc +++ b/base/time.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -98,19 +98,22 @@ Time Time::LocalMidnight() const { } // static -bool Time::FromString(const wchar_t* time_string, Time* parsed_time) { +bool Time::FromString(const char* time_string, Time* parsed_time) { DCHECK((time_string != NULL) && (parsed_time != NULL)); - std::string ascii_time_string = SysWideToUTF8(time_string); - if (ascii_time_string.length() == 0) + + if (time_string[0] == '\0') return false; + PRTime result_time = 0; - PRStatus result = PR_ParseTimeString(ascii_time_string.c_str(), PR_FALSE, + PRStatus result = PR_ParseTimeString(time_string, PR_FALSE, &result_time); if (PR_SUCCESS != result) return false; + result_time += kTimeTToMicrosecondsOffset; *parsed_time = Time(result_time); return true; + } // Time::Exploded ------------------------------------------------------------- diff --git a/base/time.h b/base/time.h index cc99faa..d0b072a 100644 --- a/base/time.h +++ b/base/time.h @@ -313,7 +313,7 @@ class BASE_API Time { // in the input string, we assume local time. // TODO(iyengar) Move the FromString/FromTimeT/ToTimeT/FromFileTime to // a new time converter class. - static bool FromString(const wchar_t* time_string, Time* parsed_time); + static bool FromString(const char* time_string, Time* parsed_time); // For serializing, use FromInternalValue to reconstitute. Please don't use // this and do arithmetic on it, as it is more error prone than using the diff --git a/base/time_unittest.cc b/base/time_unittest.cc index 6c64b48..ad68351 100644 --- a/base/time_unittest.cc +++ b/base/time_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -13,8 +13,43 @@ using base::Time; using base::TimeDelta; using base::TimeTicks; +// Specialized test fixture allowing time strings without timezones to be +// tested by comparing them to a known time in the local zone. +// See also pr_time_unittests.cc +class TimeTest : public testing::Test { + protected: + virtual void SetUp() { + // Use mktime to get a time_t, and turn it into a PRTime by converting + // seconds to microseconds. Use 15th Oct 2007 12:45:00 local. This + // must be a time guaranteed to be outside of a DST fallback hour in + // any timezone. + struct tm local_comparison_tm = { + 0, // second + 45, // minute + 12, // hour + 15, // day of month + 10 - 1, // month + 2007 - 1900, // year + 0, // day of week (ignored, output only) + 0, // day of year (ignored, output only) + -1 // DST in effect, -1 tells mktime to figure it out + }; + + time_t converted_time = mktime(&local_comparison_tm); + ASSERT_GT(converted_time, 0); + comparison_time_local_ = Time::FromTimeT(converted_time); + + // time_t representation of 15th Oct 2007 12:45:00 PDT + comparison_time_pdt_ = Time::FromTimeT(1192477500); + } + + Time comparison_time_local_; + Time comparison_time_pdt_; +}; + + // Test conversions to/from time_t and exploding/unexploding. -TEST(Time, TimeT) { +TEST_F(TimeTest, TimeT) { // C library time and exploded time. time_t now_t_1 = time(NULL); struct tm tms; @@ -52,7 +87,7 @@ TEST(Time, TimeT) { EXPECT_EQ(0, Time::FromTimeT(0).ToInternalValue()); } -TEST(Time, FromExplodedWithMilliseconds) { +TEST_F(TimeTest, FromExplodedWithMilliseconds) { // Some platform implementations of FromExploded are liable to drop // milliseconds if we aren't careful. Time now = Time::NowFromSystemTime(); @@ -65,14 +100,14 @@ TEST(Time, FromExplodedWithMilliseconds) { EXPECT_EQ(exploded1.millisecond, exploded2.millisecond); } -TEST(Time, ZeroIsSymmetric) { +TEST_F(TimeTest, ZeroIsSymmetric) { Time zero_time(Time::FromTimeT(0)); EXPECT_EQ(0, zero_time.ToTimeT()); EXPECT_EQ(0.0, zero_time.ToDoubleT()); } -TEST(Time, LocalExplode) { +TEST_F(TimeTest, LocalExplode) { Time a = Time::Now(); Time::Exploded exploded; a.LocalExplode(&exploded); @@ -85,7 +120,7 @@ TEST(Time, LocalExplode) { EXPECT_TRUE((a - b) < TimeDelta::FromSeconds(1)); } -TEST(Time, UTCExplode) { +TEST_F(TimeTest, UTCExplode) { Time a = Time::Now(); Time::Exploded exploded; a.UTCExplode(&exploded); @@ -94,7 +129,7 @@ TEST(Time, UTCExplode) { EXPECT_TRUE((a - b) < TimeDelta::FromSeconds(1)); } -TEST(Time, LocalMidnight) { +TEST_F(TimeTest, LocalMidnight) { Time::Exploded exploded; Time::Now().LocalMidnight().LocalExplode(&exploded); EXPECT_EQ(0, exploded.hour); @@ -103,6 +138,203 @@ TEST(Time, LocalMidnight) { EXPECT_EQ(0, exploded.millisecond); } +TEST_F(TimeTest, ParseTimeTest1) { + time_t current_time = 0; + time(¤t_time); + + const int BUFFER_SIZE = 64; + struct tm local_time = {0}; + char time_buf[BUFFER_SIZE] = {0}; +#if defined(OS_WIN) + localtime_s(&local_time, ¤t_time); + asctime_s(time_buf, arraysize(time_buf), &local_time); +#elif defined(OS_POSIX) + localtime_r(¤t_time, &local_time); + asctime_r(&local_time, time_buf); +#endif + + Time parsed_time; + EXPECT_TRUE(Time::FromString(time_buf, &parsed_time)); + EXPECT_EQ(current_time, parsed_time.ToTimeT()); +} + +TEST_F(TimeTest, ParseTimeTest2) { + Time parsed_time; + EXPECT_TRUE(Time::FromString("Mon, 15 Oct 2007 19:45:00 GMT", &parsed_time)); + EXPECT_EQ(comparison_time_pdt_, parsed_time); +} + +TEST_F(TimeTest, ParseTimeTest3) { + Time parsed_time; + EXPECT_TRUE(Time::FromString("15 Oct 07 12:45:00", &parsed_time)); + EXPECT_EQ(comparison_time_local_, parsed_time); +} + +TEST_F(TimeTest, ParseTimeTest4) { + Time parsed_time; + EXPECT_TRUE(Time::FromString("15 Oct 07 19:45 GMT", &parsed_time)); + EXPECT_EQ(comparison_time_pdt_, parsed_time); +} + +TEST_F(TimeTest, ParseTimeTest5) { + Time parsed_time; + EXPECT_TRUE(Time::FromString("Mon Oct 15 12:45 PDT 2007", &parsed_time)); + EXPECT_EQ(comparison_time_pdt_, parsed_time); +} + +TEST_F(TimeTest, ParseTimeTest6) { + Time parsed_time; + EXPECT_TRUE(Time::FromString("Monday, Oct 15, 2007 12:45 PM", &parsed_time)); + EXPECT_EQ(comparison_time_local_, parsed_time); +} + +TEST_F(TimeTest, ParseTimeTest7) { + Time parsed_time; + EXPECT_TRUE(Time::FromString("10/15/07 12:45:00 PM", &parsed_time)); + EXPECT_EQ(comparison_time_local_, parsed_time); +} + +TEST_F(TimeTest, ParseTimeTest8) { + Time parsed_time; + EXPECT_TRUE(Time::FromString("15-OCT-2007 12:45pm", &parsed_time)); + EXPECT_EQ(comparison_time_local_, parsed_time); +} + +TEST_F(TimeTest, ParseTimeTest9) { + Time parsed_time; + EXPECT_TRUE(Time::FromString("16 Oct 2007 4:45-JST (Tuesday)", &parsed_time)); + EXPECT_EQ(comparison_time_pdt_, parsed_time); +} + +TEST_F(TimeTest, ParseTimeTest10) { + Time parsed_time; + EXPECT_TRUE(Time::FromString("15/10/07 12:45", &parsed_time)); + EXPECT_EQ(parsed_time, comparison_time_local_); +} + +// Test some of edge cases around epoch, etc. +TEST_F(TimeTest, ParseTimeTestEpoch0) { + Time parsed_time; + + // time_t == epoch == 0 + EXPECT_TRUE(Time::FromString("Thu Jan 01 01:00:00 +0100 1970", + &parsed_time)); + EXPECT_EQ(0, parsed_time.ToTimeT()); + EXPECT_TRUE(Time::FromString("Thu Jan 01 00:00:00 GMT 1970", + &parsed_time)); + EXPECT_EQ(0, parsed_time.ToTimeT()); +} + +TEST_F(TimeTest, ParseTimeTestEpoch1) { + Time parsed_time; + + // time_t == 1 second after epoch == 1 + EXPECT_TRUE(Time::FromString("Thu Jan 01 01:00:01 +0100 1970", + &parsed_time)); + EXPECT_EQ(1, parsed_time.ToTimeT()); + EXPECT_TRUE(Time::FromString("Thu Jan 01 00:00:01 GMT 1970", + &parsed_time)); + EXPECT_EQ(1, parsed_time.ToTimeT()); +} + +TEST_F(TimeTest, ParseTimeTestEpoch2) { + Time parsed_time; + + // time_t == 2 seconds after epoch == 2 + EXPECT_TRUE(Time::FromString("Thu Jan 01 01:00:02 +0100 1970", + &parsed_time)); + EXPECT_EQ(2, parsed_time.ToTimeT()); + EXPECT_TRUE(Time::FromString("Thu Jan 01 00:00:02 GMT 1970", + &parsed_time)); + EXPECT_EQ(2, parsed_time.ToTimeT()); +} + +TEST_F(TimeTest, ParseTimeTestEpochNeg1) { + Time parsed_time; + + // time_t == 1 second before epoch == -1 + EXPECT_TRUE(Time::FromString("Thu Jan 01 00:59:59 +0100 1970", + &parsed_time)); + EXPECT_EQ(-1, parsed_time.ToTimeT()); + EXPECT_TRUE(Time::FromString("Wed Dec 31 23:59:59 GMT 1969", + &parsed_time)); + EXPECT_EQ(-1, parsed_time.ToTimeT()); +} + +// If time_t is 32 bits, a date after year 2038 will overflow time_t and +// cause timegm() to return -1. The parsed time should not be 1 second +// before epoch. +TEST_F(TimeTest, ParseTimeTestEpochNotNeg1) { + Time parsed_time; + + EXPECT_TRUE(Time::FromString("Wed Dec 31 23:59:59 GMT 2100", + &parsed_time)); + EXPECT_NE(-1, parsed_time.ToTimeT()); +} + +TEST_F(TimeTest, ParseTimeTestEpochNeg2) { + Time parsed_time; + + // time_t == 2 seconds before epoch == -2 + EXPECT_TRUE(Time::FromString("Thu Jan 01 00:59:58 +0100 1970", + &parsed_time)); + EXPECT_EQ(-2, parsed_time.ToTimeT()); + EXPECT_TRUE(Time::FromString("Wed Dec 31 23:59:58 GMT 1969", + &parsed_time)); + EXPECT_EQ(-2, parsed_time.ToTimeT()); +} + +TEST_F(TimeTest, ParseTimeTestEpoch1960) { + Time parsed_time; + + // time_t before Epoch, in 1960 + EXPECT_TRUE(Time::FromString("Wed Jun 29 19:40:01 +0100 1960", + &parsed_time)); + EXPECT_EQ(-299999999, parsed_time.ToTimeT()); + EXPECT_TRUE(Time::FromString("Wed Jun 29 18:40:01 GMT 1960", + &parsed_time)); + EXPECT_EQ(-299999999, parsed_time.ToTimeT()); + EXPECT_TRUE(Time::FromString("Wed Jun 29 17:40:01 GMT 1960", + &parsed_time)); + EXPECT_EQ(-300003599, parsed_time.ToTimeT()); +} + +TEST_F(TimeTest, ParseTimeTestEmpty) { + Time parsed_time; + EXPECT_FALSE(Time::FromString("", &parsed_time)); +} + +TEST_F(TimeTest, ParseTimeTestInvalidString) { + Time parsed_time; + EXPECT_FALSE(Time::FromString("Monday morning 2000", &parsed_time)); +} + +// This test should not crash when compiled with Visual C++ 2005 (see +// http://crbug.com/4387). +TEST_F(TimeTest, ParseTimeTestOutOfRange) { + // Note the lack of timezone in the time string. The year has to be 3001. + // The date has to be after 23:59:59, December 31, 3000, US Pacific Time, so + // we use January 2, 3001 to make sure it's after the magic maximum in any + // timezone. + Time parsed_time; + EXPECT_TRUE(Time::FromString("Sun Jan 2 00:00:00 3001", &parsed_time)); +} + +TEST_F(TimeTest, ParseTimeTestNotNormalized1) { + Time parsed_time; + EXPECT_TRUE(Time::FromString("Mon Oct 15 12:44:60 PDT 2007", + &parsed_time)); + EXPECT_EQ(comparison_time_pdt_, parsed_time); +} + +TEST_F(TimeTest, ParseTimeTestNotNormalized2) { + Time parsed_time; + EXPECT_TRUE(Time::FromString("Sun Oct 14 36:45 PDT 2007", + &parsed_time)); + EXPECT_EQ(comparison_time_pdt_, parsed_time); +} + + TEST(TimeTicks, Deltas) { for (int index = 0; index < 50; index++) { TimeTicks ticks_start = TimeTicks::Now(); |