| 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..aa6480f65837bd88d213bb9ba54f84950475b701 100644
|
| --- a/extensions/renderer/module_system_test.cc
|
| +++ b/extensions/renderer/module_system_test.cc
|
| @@ -209,18 +209,33 @@ v8::Handle<v8::Object> ModuleSystemTestEnvironment::CreateGlobal(
|
|
|
| ModuleSystemTest::ModuleSystemTest()
|
| : isolate_(v8::Isolate::GetCurrent()),
|
| - env_(CreateEnvironment()),
|
| should_assertions_be_made_(true) {
|
| }
|
|
|
| ModuleSystemTest::~ModuleSystemTest() {
|
| }
|
|
|
| +void ModuleSystemTest::SetUp() {
|
| + env_ = CreateEnvironment();
|
| +}
|
| +
|
| void ModuleSystemTest::TearDown() {
|
| // All tests must assert at least once unless otherwise specified.
|
| 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);
|
| + }
|
| }
|
|
|
| scoped_ptr<ModuleSystemTestEnvironment> ModuleSystemTest::CreateEnvironment() {
|
|
|