1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
7 from telemetry.unittest import tab_test_case
10 class InspectorMemoryTest(tab_test_case.TabTestCase):
12 def testGetDOMStats(self):
13 if not self._browser.supports_tab_control:
14 logging.warning('Browser does not support tab control, skipping test.')
17 # Due to an issue with CrOS, we create a new tab here rather than
18 # using the existing tab to get a consistent starting page on all platforms.
19 self._tab = self._browser.tabs.New()
21 self.Navigate('dom_counter_sample.html')
23 counts = self._tab.dom_stats
24 self.assertEqual(counts['document_count'], 1)
25 self.assertEqual(counts['node_count'], 14)
26 self.assertEqual(counts['event_listener_count'], 2)