Chromium Code Reviews| Index: test/cctest/test-heap.cc |
| diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
| index 55bb466416fa352a6785cd79c757f272be04d0d1..48deedacd97587e9e486771749ffaa5be12d1882 100644 |
| --- a/test/cctest/test-heap.cc |
| +++ b/test/cctest/test-heap.cc |
| @@ -3890,3 +3890,26 @@ TEST(AddInstructionChangesNewSpacePromotion) { |
| heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| } |
| #endif |
| + |
| + |
| +void OnFatalErrorExpectOOM(const char* location, const char* message) { |
| + // Exit with 0 if the location matches our expectation. |
| + exit(strcmp(location, "CALL_AND_RETRY_LAST")); |
| +} |
| + |
| + |
| +TEST(CEntryStubOOM) { |
| + i::FLAG_allow_natives_syntax = true; |
| + CcTest::InitializeVM(); |
| + v8::HandleScope scope(CcTest::isolate()); |
| + v8::V8::SetFatalErrorHandler(OnFatalErrorExpectOOM); |
| + |
| + CompileRun( |
| + "%SetFlags('--gc-interval=1');" |
| + "var a = [];" |
| + "a.__proto__ = [];" |
| + "a.unshift(1)"); |
| + |
| + // We should have ran into an out of memory. |
|
Jakob Kummerow
2014/03/27 09:05:21
nit: s/ran/run/
Yang
2014/03/27 09:26:36
Done.
|
| + UNREACHABLE(); |
|
Jakob Kummerow
2014/03/27 09:05:21
Use CHECK(false) here so it does something in Rele
Yang
2014/03/27 09:26:36
Obsolete now that we moved the entire test to debu
|
| +} |