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

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 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
« no previous file with comments | « 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 #ifdef V8_I18N_SUPPORT
171 TEST(DateCacheVersion) {
172 FLAG_allow_natives_syntax = true;
173 v8::Isolate* isolate = CcTest::isolate();
174 v8::Isolate::Scope isolate_scope(isolate);
175 v8::HandleScope scope(isolate);
176 v8::Local<v8::Context> context = v8::Context::New(isolate);
177 v8::Context::Scope context_scope(context);
178 v8::Local<v8::Number> date_cache_version =
179 v8::Local<v8::Number>::Cast(CompileRun("%DateCacheVersion()"));
180
181 CHECK(date_cache_version->IsNumber());
182 CHECK_EQ(0.0, date_cache_version->NumberValue(context).FromMaybe(-1.0));
183
184 v8::Date::DateTimeConfigurationChangeNotification(isolate);
185
186 date_cache_version =
187 v8::Local<v8::Number>::Cast(CompileRun("%DateCacheVersion()"));
188 CHECK(date_cache_version->IsNumber());
189 CHECK_EQ(1.0, date_cache_version->NumberValue(context).FromMaybe(-1.0));
190 }
191 #endif // V8_I18N_SUPPORT
OLDNEW
« 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