Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: tools/telemetry/telemetry/core/chrome/inspector_memory_unittest.py

Issue 12800004: [Telemetry] Add tab API function GetJavascriptStats(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed second round of review comments. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/core/chrome/inspector_memory.py ('k') | tools/telemetry/telemetry/core/tab.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « tools/telemetry/telemetry/core/chrome/inspector_memory.py ('k') | tools/telemetry/telemetry/core/tab.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698