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.
5 from telemetry.core import util
6 from telemetry.unittest import tab_test_case
8 class InspectorMemoryTest(tab_test_case.TabTestCase):
9 def testGetDOMStats(self):
10 self._browser.SetHTTPServerDirectories(util.GetUnittestDataDir())
12 # Due to an issue with CrOS, we create a new tab here rather than
13 # using self._tab to get a consistent starting page on all platforms
14 tab = self._browser.tabs.New()
17 self._browser.http_server.UrlOf('dom_counter_sample.html'))
18 tab.WaitForDocumentReadyStateToBeComplete()
20 counts = tab.dom_stats
21 self.assertEqual(counts['document_count'], 2)
22 self.assertEqual(counts['node_count'], 18)
23 self.assertEqual(counts['event_listener_count'], 2)