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

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

Issue 189913023: Use a per-isolate cache for the date object JS bits (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 9 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.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 460c07e5aaad938fc1fc000cff08b7263c185ecf..5190729fad17d6e7b0b3ae504d6f92f012dbb7a8 100644
--- a/test/cctest/test-date.cc
+++ b/test/cctest/test-date.cc
@@ -167,3 +167,25 @@ TEST(DaylightSavingsTime) {
CheckDST(august_20 + 2 * 3600 - 1000);
CheckDST(august_20);
}
+
+
+TEST(DateCacheVersion) {
+ FLAG_allow_natives_syntax = true;
+ v8::Isolate* isolate = CcTest::isolate();
+ v8::Isolate::Scope isolate_scope(isolate);
+ v8::HandleScope scope(isolate);
+ v8::Handle<v8::Context> context = v8::Context::New(isolate);
+ v8::Context::Scope context_scope(context);
+ v8::Handle<v8::Array> date_cache_version =
+ v8::Handle<v8::Array>::Cast(CompileRun("%DateCacheVersion()"));
+
+ CHECK_EQ(1, static_cast<int32_t>(date_cache_version->Length()));
+ CHECK(date_cache_version->Get(0)->IsNumber());
+ CHECK_EQ(0.0, date_cache_version->Get(0)->NumberValue());
+
+ v8::Date::DateTimeConfigurationChangeNotification(isolate);
+
+ CHECK_EQ(1, static_cast<int32_t>(date_cache_version->Length()));
+ CHECK(date_cache_version->Get(0)->IsNumber());
+ CHECK_EQ(1.0, date_cache_version->Get(0)->NumberValue());
+}
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698