Index: extensions/renderer/module_system_test.cc |
diff --git a/extensions/renderer/module_system_test.cc b/extensions/renderer/module_system_test.cc |
index 4f4675e625610be86972476ac2dca54fd4e68d07..8852686e6acca566b429cbc0ae9f602dd8b8690a 100644 |
--- a/extensions/renderer/module_system_test.cc |
+++ b/extensions/renderer/module_system_test.cc |
@@ -221,6 +221,18 @@ void ModuleSystemTest::TearDown() { |
EXPECT_EQ(should_assertions_be_made_, |
env_->assert_natives()->assertion_made()); |
EXPECT_FALSE(env_->assert_natives()->failed()); |
+ env_.reset(); |
+ v8::HeapStatistics stats; |
+ isolate_->GetHeapStatistics(&stats); |
+ size_t old_heap_size = 0; |
+ // Run the GC until the heap size reaches a steady state to ensure that |
+ // all the garbage is collected. |
+ while (stats.used_heap_size() != old_heap_size) { |
+ old_heap_size = stats.used_heap_size(); |
+ isolate_->RequestGarbageCollectionForTesting( |
+ v8::Isolate::kFullGarbageCollection); |
+ isolate_->GetHeapStatistics(&stats); |
+ } |
not at google - send to devlin
2014/08/28 15:42:04
Yikes :(
|
} |
scoped_ptr<ModuleSystemTestEnvironment> ModuleSystemTest::CreateEnvironment() { |