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

Side by Side Diff: test/cctest/test-date.cc

Issue 23534067: bulk replace Isolate::Current in tests (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-dataflow.cc ('k') | test/cctest/test-debug.cc » ('j') | 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 static int64_t TimeFromYearMonthDay(DateCache* date_cache, 102 static int64_t TimeFromYearMonthDay(DateCache* date_cache,
103 int year, 103 int year,
104 int month, 104 int month,
105 int day) { 105 int day) {
106 int64_t result = date_cache->DaysFromYearMonth(year, month); 106 int64_t result = date_cache->DaysFromYearMonth(year, month);
107 return (result + day - 1) * DateCache::kMsPerDay; 107 return (result + day - 1) * DateCache::kMsPerDay;
108 } 108 }
109 109
110 110
111 static void CheckDST(int64_t time) { 111 static void CheckDST(int64_t time) {
112 Isolate* isolate = Isolate::Current(); 112 Isolate* isolate = CcTest::i_isolate();
113 DateCache* date_cache = isolate->date_cache(); 113 DateCache* date_cache = isolate->date_cache();
114 int64_t actual = date_cache->ToLocal(time); 114 int64_t actual = date_cache->ToLocal(time);
115 int64_t expected = time + date_cache->GetLocalOffsetFromOS() + 115 int64_t expected = time + date_cache->GetLocalOffsetFromOS() +
116 date_cache->GetDaylightSavingsOffsetFromOS(time / 1000); 116 date_cache->GetDaylightSavingsOffsetFromOS(time / 1000);
117 CHECK_EQ(actual, expected); 117 CHECK_EQ(actual, expected);
118 } 118 }
119 119
120 120
121 TEST(DaylightSavingsTime) { 121 TEST(DaylightSavingsTime) {
122 LocalContext context; 122 LocalContext context;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 CheckDST(TimeFromYearMonthDay(date_cache, year, 5, 5)); 160 CheckDST(TimeFromYearMonthDay(date_cache, year, 5, 5));
161 } 161 }
162 CheckDST((august_20 + september_10) / 2); 162 CheckDST((august_20 + september_10) / 2);
163 CheckDST(september_10); 163 CheckDST(september_10);
164 CheckDST(september_10 + 2 * 3600); 164 CheckDST(september_10 + 2 * 3600);
165 CheckDST(september_10 + 2 * 3600 - 1000); 165 CheckDST(september_10 + 2 * 3600 - 1000);
166 CheckDST(august_20 + 2 * 3600); 166 CheckDST(august_20 + 2 * 3600);
167 CheckDST(august_20 + 2 * 3600 - 1000); 167 CheckDST(august_20 + 2 * 3600 - 1000);
168 CheckDST(august_20); 168 CheckDST(august_20);
169 } 169 }
OLDNEW
« no previous file with comments | « test/cctest/test-dataflow.cc ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698