OLD | NEW |
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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #include "include/v8.h" | 28 #include "include/v8.h" |
29 #include "test/cctest/cctest.h" | 29 #include "test/cctest/cctest.h" |
30 | 30 |
31 #include "include/libplatform/libplatform.h" | 31 #include "include/libplatform/libplatform.h" |
32 #include "src/debug/debug.h" | 32 #include "src/debug/debug.h" |
33 #include "test/cctest/print-extension.h" | 33 #include "test/cctest/print-extension.h" |
34 #include "test/cctest/profiler-extension.h" | 34 #include "test/cctest/profiler-extension.h" |
35 #include "test/cctest/trace-extension.h" | 35 #include "test/cctest/trace-extension.h" |
36 | 36 |
37 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | |
38 #include "src/startup-data-util.h" | |
39 #endif // V8_USE_EXTERNAL_STARTUP_DATA | |
40 | |
41 #if V8_OS_WIN | 37 #if V8_OS_WIN |
42 #include <windows.h> // NOLINT | 38 #include <windows.h> // NOLINT |
43 #if V8_CC_MSVC | 39 #if V8_CC_MSVC |
44 #include <crtdbg.h> | 40 #include <crtdbg.h> |
45 #endif | 41 #endif |
46 #endif | 42 #endif |
47 | 43 |
48 enum InitializationState {kUnset, kUnintialized, kInitialized}; | 44 enum InitializationState {kUnset, kUnintialized, kInitialized}; |
49 static InitializationState initialization_state_ = kUnset; | 45 static InitializationState initialization_state_ = kUnset; |
50 static bool disable_automatic_dispose_ = false; | 46 static bool disable_automatic_dispose_ = false; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); | 171 _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); |
176 _set_error_mode(_OUT_TO_STDERR); | 172 _set_error_mode(_OUT_TO_STDERR); |
177 #endif // V8_CC_MSVC | 173 #endif // V8_CC_MSVC |
178 #endif // V8_OS_WIN | 174 #endif // V8_OS_WIN |
179 | 175 |
180 v8::V8::InitializeICU(); | 176 v8::V8::InitializeICU(); |
181 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 177 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
182 v8::V8::InitializePlatform(platform); | 178 v8::V8::InitializePlatform(platform); |
183 v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); | 179 v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
184 v8::V8::Initialize(); | 180 v8::V8::Initialize(); |
185 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 181 v8::V8::InitializeExternalStartupData(argv[0]); |
186 v8::StartupDataHandler startup_data(argv[0], NULL, NULL); | |
187 #endif | |
188 | 182 |
189 CcTestArrayBufferAllocator array_buffer_allocator; | 183 CcTestArrayBufferAllocator array_buffer_allocator; |
190 CcTest::set_array_buffer_allocator(&array_buffer_allocator); | 184 CcTest::set_array_buffer_allocator(&array_buffer_allocator); |
191 | 185 |
192 i::PrintExtension print_extension; | 186 i::PrintExtension print_extension; |
193 v8::RegisterExtension(&print_extension); | 187 v8::RegisterExtension(&print_extension); |
194 i::ProfilerExtension profiler_extension; | 188 i::ProfilerExtension profiler_extension; |
195 v8::RegisterExtension(&profiler_extension); | 189 v8::RegisterExtension(&profiler_extension); |
196 i::TraceExtension trace_extension; | 190 i::TraceExtension trace_extension; |
197 v8::RegisterExtension(&trace_extension); | 191 v8::RegisterExtension(&trace_extension); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 CcTest::TearDown(); | 240 CcTest::TearDown(); |
247 // TODO(svenpanne) See comment above. | 241 // TODO(svenpanne) See comment above. |
248 // if (!disable_automatic_dispose_) v8::V8::Dispose(); | 242 // if (!disable_automatic_dispose_) v8::V8::Dispose(); |
249 v8::V8::ShutdownPlatform(); | 243 v8::V8::ShutdownPlatform(); |
250 delete platform; | 244 delete platform; |
251 return 0; | 245 return 0; |
252 } | 246 } |
253 | 247 |
254 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; | 248 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; |
255 int RegisterThreadedTest::count_ = 0; | 249 int RegisterThreadedTest::count_ = 0; |
OLD | NEW |