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

Unified Diff: tools/telemetry/telemetry/tracing_backend_unittest.py

Issue 11548032: Telemetry / Devtools TraceHandler: exposes tracing via dev tools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Error handling and comments Created 8 years 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/tracing_backend.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/tracing_backend_unittest.py
diff --git a/tools/telemetry/telemetry/tracing_backend_unittest.py b/tools/telemetry/telemetry/tracing_backend_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..7a8370d0d1be907930c04e325ceb6f5ca4ea7eda
--- /dev/null
+++ b/tools/telemetry/telemetry/tracing_backend_unittest.py
@@ -0,0 +1,33 @@
+# Copyright (c) 2012 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 json
+import os
+
+from telemetry import tab_test_case
+from telemetry import util
+
+
+class TracingBackendTest(tab_test_case.TabTestCase):
+ def _StartServer(self):
+ base_dir = os.path.dirname(__file__)
+ self._browser.SetHTTPServerDirectory(os.path.join(base_dir, '..',
+ 'unittest_data'))
+
+ def _WaitForAnimationFrame(self):
+ def _IsDone():
+ js_is_done = """done"""
+ return bool(self._tab.runtime.Evaluate(js_is_done))
+ util.WaitFor(_IsDone, 5)
+
+ def testGotTrace(self):
+ self._StartServer()
+ self._browser.StartTracing()
+ self._browser.http_server.UrlOf('image.png')
marja 2013/01/31 16:13:39 Btw, why this UrlOf line? (Asks nduca in another c
+ self.assertTrue(self._browser.supports_tracing)
+ self._browser.StopTracing()
+ trace = self._browser.GetTrace()
+ json_trace = json.loads(trace)
+ self.assertTrue('traceEvents' in json_trace)
+ self.assertTrue(json_trace['traceEvents'])
« no previous file with comments | « tools/telemetry/telemetry/tracing_backend.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698