Index: tools/telemetry/telemetry/core/chrome/inspector_memory_unittest.py |
diff --git a/tools/telemetry/telemetry/core/chrome/inspector_memory_unittest.py b/tools/telemetry/telemetry/core/chrome/inspector_memory_unittest.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a84be787109eddd0ec80fbb5f998fe9c61c953f9 |
--- /dev/null |
+++ b/tools/telemetry/telemetry/core/chrome/inspector_memory_unittest.py |
@@ -0,0 +1,21 @@ |
+# Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+import os |
+ |
+from telemetry.test import tab_test_case |
+ |
+class InspectorMemoryTest(tab_test_case.TabTestCase): |
+ def testGetDOMStats(self): |
+ unittest_data_dir = os.path.join(os.path.dirname(__file__), |
+ '..', '..', '..', 'unittest_data') |
+ self._browser.SetHTTPServerDirectory(unittest_data_dir) |
+ |
+ self._tab.Navigate( |
+ self._browser.http_server.UrlOf('dom_counter_sample.html')) |
+ self._tab.WaitForDocumentReadyStateToBeComplete() |
+ |
+ counts = self._tab.dom_stats |
+ self.assertEqual(counts['document_count'], 1) |
+ self.assertEqual(counts['node_count'], 14) |
+ self.assertEqual(counts['event_listener_count'], 2) |