Chromium Code Reviews| Index: test/cctest/cctest.cc |
| diff --git a/test/cctest/cctest.cc b/test/cctest/cctest.cc |
| index b241f32a01ac000cccc9a32ded1e5bf83eccc2b0..e134598cd6bad61ea41f4a891e83cecd0637a8bf 100644 |
| --- a/test/cctest/cctest.cc |
| +++ b/test/cctest/cctest.cc |
| @@ -98,10 +98,21 @@ static void PrintTestList(CcTest* current) { |
| v8::Isolate* CcTest::default_isolate_; |
| +class CcTestArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
| + public: |
| + virtual void* Allocate(size_t length) { return malloc(length); } |
| + virtual void Free(void* data) { free(data); } |
| +}; |
| + |
| + |
| int main(int argc, char* argv[]) { |
| v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
| v8::internal::FLAG_harmony_array_buffer = true; |
| v8::internal::FLAG_harmony_typed_arrays = true; |
| + |
| + static CcTestArrayBufferAllocator array_buffer_allocator; |
|
Sven Panne
2013/06/11 09:54:37
Why do we need "static"?
Dmitry Lomov (no reviews)
2013/06/11 10:40:09
Done.
|
| + v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); |
| + |
| CcTest::set_default_isolate(v8::Isolate::GetCurrent()); |
| CHECK(CcTest::default_isolate() != NULL); |
| int tests_run = 0; |