Commit c6f6c5a7 authored by Stephen Kyle's avatar Stephen Kyle Committed by Commit Bot

blink/heap: ensure finalizer tests are repeatable

The static |destructor_calls_| variables used with the
HeapTest.Finalization and HeapTest.SimpleFinalization tests were not
being reset to 0 on subsequent runs of the test
(e.g. when running with --gtest_repeat).

BUG=899757

Change-Id: I55419a946431267cf88122aae80ae46fcbe8f467
Reviewed-on: https://chromium-review.googlesource.com/c/1309693Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604201}
parent 50835b60
......@@ -1901,6 +1901,7 @@ TEST(HeapTest, SimplePersistent) {
TEST(HeapTest, SimpleFinalization) {
{
SimpleFinalizedObject::destructor_calls_ = 0;
Persistent<SimpleFinalizedObject> finalized =
SimpleFinalizedObject::Create();
EXPECT_EQ(0, SimpleFinalizedObject::destructor_calls_);
......@@ -2072,6 +2073,8 @@ TEST(HeapTest, EagerlySweepingPages) {
TEST(HeapTest, Finalization) {
{
HeapTestSubClass::destructor_calls_ = 0;
HeapTestSuperClass::destructor_calls_ = 0;
HeapTestSubClass* t1 = HeapTestSubClass::Create();
HeapTestSubClass* t2 = HeapTestSubClass::Create();
HeapTestSuperClass* t3 = HeapTestSuperClass::Create();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment