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

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

Issue 583153002: Reland 24052 - Require V8 to be explicitly initialized before an Isolate is created (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/cctest.h ('k') | test/cctest/test-api.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 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); 157 _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
158 _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); 158 _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE);
159 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); 159 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
160 _set_error_mode(_OUT_TO_STDERR); 160 _set_error_mode(_OUT_TO_STDERR);
161 #endif // _MSC_VER 161 #endif // _MSC_VER
162 #endif // defined(_WIN32) || defined(_WIN64) 162 #endif // defined(_WIN32) || defined(_WIN64)
163 163
164 v8::V8::InitializeICU(); 164 v8::V8::InitializeICU();
165 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); 165 v8::Platform* platform = v8::platform::CreateDefaultPlatform();
166 v8::V8::InitializePlatform(platform); 166 v8::V8::InitializePlatform(platform);
167
168 v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); 167 v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
168 v8::V8::Initialize();
169 169
170 CcTestArrayBufferAllocator array_buffer_allocator; 170 CcTestArrayBufferAllocator array_buffer_allocator;
171 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); 171 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator);
172 172
173 i::PrintExtension print_extension; 173 i::PrintExtension print_extension;
174 v8::RegisterExtension(&print_extension); 174 v8::RegisterExtension(&print_extension);
175 i::ProfilerExtension profiler_extension; 175 i::ProfilerExtension profiler_extension;
176 v8::RegisterExtension(&profiler_extension); 176 v8::RegisterExtension(&profiler_extension);
177 i::TraceExtension trace_extension; 177 i::TraceExtension trace_extension;
178 v8::RegisterExtension(&trace_extension); 178 v8::RegisterExtension(&trace_extension);
179 179
180 int tests_run = 0; 180 int tests_run = 0;
181 bool print_run_count = true; 181 bool print_run_count = true;
182 for (int i = 1; i < argc; i++) { 182 for (int i = 1; i < argc; i++) {
183 char* arg = argv[i]; 183 char* arg = argv[i];
184 if (strcmp(arg, "--list") == 0) { 184 if (strcmp(arg, "--list") == 0) {
185 // TODO(svenpanne) Serializer::enabled() and Serializer::code_address_map_
186 // are fundamentally broken, so we can't unconditionally initialize and
187 // dispose V8.
188 v8::V8::Initialize();
189 PrintTestList(CcTest::last()); 185 PrintTestList(CcTest::last());
190 print_run_count = false; 186 print_run_count = false;
191 187
192 } else { 188 } else {
193 char* arg_copy = v8::internal::StrDup(arg); 189 char* arg_copy = v8::internal::StrDup(arg);
194 char* testname = strchr(arg_copy, '/'); 190 char* testname = strchr(arg_copy, '/');
195 if (testname) { 191 if (testname) {
196 // Split the string in two by nulling the slash and then run 192 // Split the string in two by nulling the slash and then run
197 // exact matches. 193 // exact matches.
198 *testname = 0; 194 *testname = 0;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 CcTest::TearDown(); 227 CcTest::TearDown();
232 // TODO(svenpanne) See comment above. 228 // TODO(svenpanne) See comment above.
233 // if (!disable_automatic_dispose_) v8::V8::Dispose(); 229 // if (!disable_automatic_dispose_) v8::V8::Dispose();
234 v8::V8::ShutdownPlatform(); 230 v8::V8::ShutdownPlatform();
235 delete platform; 231 delete platform;
236 return 0; 232 return 0;
237 } 233 }
238 234
239 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; 235 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL;
240 int RegisterThreadedTest::count_ = 0; 236 int RegisterThreadedTest::count_ = 0;
OLDNEW
« no previous file with comments | « test/cctest/cctest.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698