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

Unified Diff: test/cctest/test-date.cc

Issue 1985423003: Invalidate defaultObjects if timezone changes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixes after review Created 4 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/runtime/runtime-i18n.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-date.cc
diff --git a/test/cctest/test-date.cc b/test/cctest/test-date.cc
index 67b950159292d2e15c648008f2fb7d9fd4f151f4..c2f196c0a48a5fecc90eb9f5df8b6b88b01fa7a6 100644
--- a/test/cctest/test-date.cc
+++ b/test/cctest/test-date.cc
@@ -166,3 +166,26 @@ TEST(DaylightSavingsTime) {
CheckDST(august_20 + 2 * 3600 - 1000);
CheckDST(august_20);
}
+
+#ifdef V8_I18N_SUPPORT
+TEST(DateCacheVersion) {
+ FLAG_allow_natives_syntax = true;
+ v8::Isolate* isolate = CcTest::isolate();
+ v8::Isolate::Scope isolate_scope(isolate);
+ v8::HandleScope scope(isolate);
+ v8::Local<v8::Context> context = v8::Context::New(isolate);
+ v8::Context::Scope context_scope(context);
+ v8::Local<v8::Number> date_cache_version =
+ v8::Local<v8::Number>::Cast(CompileRun("%DateCacheVersion()"));
+
+ CHECK(date_cache_version->IsNumber());
+ CHECK_EQ(0.0, date_cache_version->NumberValue(context).FromMaybe(-1.0));
+
+ v8::Date::DateTimeConfigurationChangeNotification(isolate);
+
+ date_cache_version =
+ v8::Local<v8::Number>::Cast(CompileRun("%DateCacheVersion()"));
+ CHECK(date_cache_version->IsNumber());
+ CHECK_EQ(1.0, date_cache_version->NumberValue(context).FromMaybe(-1.0));
+}
+#endif // V8_I18N_SUPPORT
« no previous file with comments | « src/runtime/runtime-i18n.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698