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

Side by Side 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+DateCacheVersion should be called each time in checkDateCacheCurrent 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 unified diff | Download patch
« src/js/i18n.js ('K') | « src/runtime/runtime-i18n.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 CheckDST(TimeFromYearMonthDay(date_cache, year, 5, 5)); 159 CheckDST(TimeFromYearMonthDay(date_cache, year, 5, 5));
160 } 160 }
161 CheckDST((august_20 + september_10) / 2); 161 CheckDST((august_20 + september_10) / 2);
162 CheckDST(september_10); 162 CheckDST(september_10);
163 CheckDST(september_10 + 2 * 3600); 163 CheckDST(september_10 + 2 * 3600);
164 CheckDST(september_10 + 2 * 3600 - 1000); 164 CheckDST(september_10 + 2 * 3600 - 1000);
165 CheckDST(august_20 + 2 * 3600); 165 CheckDST(august_20 + 2 * 3600);
166 CheckDST(august_20 + 2 * 3600 - 1000); 166 CheckDST(august_20 + 2 * 3600 - 1000);
167 CheckDST(august_20); 167 CheckDST(august_20);
168 } 168 }
169
170 TEST(DateCacheVersion) {
jungshik at Google 2016/05/19 22:10:31 This test has to be enclosed by #ifdef V8_I18N_SU
pgorszkowski 2016/05/20 13:14:56 Done.
171 FLAG_allow_natives_syntax = true;
172 v8::Isolate* isolate = CcTest::isolate();
173 v8::Isolate::Scope isolate_scope(isolate);
174 v8::HandleScope scope(isolate);
175 v8::Local<v8::Context> context = v8::Context::New(isolate);
176 v8::Context::Scope context_scope(context);
177 v8::Local<v8::Array> date_cache_version =
178 v8::Local<v8::Array>::Cast(CompileRun("%DateCacheVersion()"));
jungshik at Google 2016/05/19 22:10:31 Asan test failed because DateCacheVersion is chang
pgorszkowski 2016/05/20 13:14:56 Done.
179
180 CHECK_EQ(1, static_cast<int32_t>(date_cache_version->Length()));
181 CHECK(date_cache_version->Get(context, 0).ToLocalChecked()->IsNumber());
182 CHECK_EQ(0.0, date_cache_version->Get(context, 0)
183 .ToLocalChecked()
184 ->NumberValue(context)
185 .FromJust());
186
187 v8::Date::DateTimeConfigurationChangeNotification(isolate);
188
189 CHECK_EQ(1, static_cast<int32_t>(date_cache_version->Length()));
190 CHECK(date_cache_version->Get(context, 0).ToLocalChecked()->IsNumber());
191 CHECK_EQ(1.0, date_cache_version->Get(context, 0)
192 .ToLocalChecked()
193 ->NumberValue(context)
194 .FromJust());
195 }
OLDNEW
« src/js/i18n.js ('K') | « src/runtime/runtime-i18n.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698