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

Unified Diff: test/cctest/test-api.cc

Issue 2593043002: [heap] New API for increasing the heap limit for debugging. (Closed)
Patch Set: add test Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index cb28aadc9b7cbebbcab06e1dcbb458c179d7d221..2e1304064e0f68352415c9bb3f842253d6c34b66 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -26592,3 +26592,22 @@ TEST(SetPrototypeTemplate) {
ExpectTrue("Image.prototype === HTMLImageElement.prototype");
}
+
+UNINITIALIZED_TEST(IncreaseHeapLimitForDebugging) {
+ using namespace i;
+ v8::Isolate::CreateParams create_params;
+ create_params.constraints.set_max_old_space_size(16);
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
+ Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate);
+ {
+ size_t limit_before = i_isolate->heap()->MaxOldGenerationSize();
+ CHECK_EQ(16 * MB, limit_before);
+ isolate->IncreaseHeapLimitForDebugging();
+ size_t limit_after = i_isolate->heap()->MaxOldGenerationSize();
+ CHECK_EQ(4 * 16 * MB, limit_after);
+ isolate->RestoreOriginalHeapLimit();
+ CHECK_EQ(limit_before, i_isolate->heap()->MaxOldGenerationSize());
+ }
+ isolate->Dispose();
+}
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698