Commit 2c9ef53f authored by yutak's avatar yutak Committed by Commit bot

Run V8 GC before detecting Document leaks in inspector_memory_unittest.py.

Previously, this unit test was consistently failing because DOM wrappers were
retained at the time of detecting Document leaks. This patch adds a call to
V8's gc() before the leak check to make sure the DOM wrappers are freed.

BUG=422244
R=kouhei@chromium.org

Review URL: https://codereview.chromium.org/882913002

Cr-Commit-Position: refs/heads/master@{#313471}
parent 0b705112
......@@ -9,7 +9,6 @@ from telemetry.unittest_util import tab_test_case
class InspectorMemoryTest(tab_test_case.TabTestCase):
@decorators.Enabled('has tabs')
@decorators.Disabled # http://crbug.com/422244
def testGetDOMStats(self):
# Due to an issue with CrOS, we create a new tab here rather than
# using the existing tab to get a consistent starting page on all platforms.
......@@ -17,6 +16,8 @@ class InspectorMemoryTest(tab_test_case.TabTestCase):
self.Navigate('dom_counter_sample.html')
self._tab.ExecuteJavaScript('gc();')
# Document_count > 1 indicates that WebCore::Document loaded in Chrome
# is leaking! The baseline should exactly match the numbers on:
# unittest_data/dom_counter_sample.html
......@@ -29,3 +30,7 @@ class InspectorMemoryTest(tab_test_case.TabTestCase):
'Node leak is detected!')
self.assertEqual(counts['event_listener_count'], 2,
'EventListener leak is detected!')
@classmethod
def CustomizeBrowserOptions(cls, options):
options.AppendExtraBrowserArgs('--js-flags=--expose-gc')
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