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

Unified Diff: base/time/time_win_unittest.cc

Issue 2241603002: Add explicit TimeDelta constexpr copy constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl feedback -- windows only Created 4 years, 4 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 | « base/time/time.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time_win_unittest.cc
diff --git a/base/time/time_win_unittest.cc b/base/time/time_win_unittest.cc
index ad5e0beb40adfe7c258fc0eb3578c69bb478963a..17c722300d681d67d0010503bace12773b236585 100644
--- a/base/time/time_win_unittest.cc
+++ b/base/time/time_win_unittest.cc
@@ -19,6 +19,11 @@
namespace base {
namespace {
+// For TimeDelta::ConstexprInitialization
+constexpr int kExpectedDeltaInMilliseconds = 10;
+constexpr TimeDelta kConstexprTimeDelta =
+ TimeDelta::FromMilliseconds(kExpectedDeltaInMilliseconds);
+
class MockTimeTicks : public TimeTicks {
public:
static DWORD Ticker() {
@@ -290,4 +295,9 @@ TEST(TimeTicks, FromQPCValue) {
}
}
+TEST(TimeDelta, ConstexprInitialization) {
+ // Make sure that TimeDelta works around crbug.com/635974
+ EXPECT_EQ(kExpectedDeltaInMilliseconds, kConstexprTimeDelta.InMilliseconds());
Jeffrey Yasskin 2016/08/12 23:07:44 You're testing a bug in constexpr variables, so yo
+}
+
} // namespace base
« no previous file with comments | « base/time/time.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698