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

Unified Diff: chrome/test/functional/tracing/tracing_smoke_test.py

Issue 10736055: Smoke test for tracing infrastructure in PyAuto (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix up style issues. Add suite to PYAUTO_TESTS Created 8 years, 5 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
Index: chrome/test/functional/tracing/tracing_smoke_test.py
diff --git a/chrome/test/functional/tracing/tracing_smoke_test.py b/chrome/test/functional/tracing/tracing_smoke_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..a1cf7079e2489124c8cca13f5fc9660551dbd70d
--- /dev/null
+++ b/chrome/test/functional/tracing/tracing_smoke_test.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+# Copyright (c) 2011 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 unittest
+
+import pyauto_tracing
+import pyauto
+import tracer
+
Nirnimesh 2012/07/30 21:03:51 Need 2 blank lines at global scope
+class TracingSmokeTest(pyauto.PyUITest):
Nirnimesh 2012/07/30 21:03:51 Docstring please
+ def setUp(self):
+ super(TracingSmokeTest, self).setUp()
+ self._tracer_factory = tracer.TracerFactory(self)
+
+ def testGetData(self):
Nirnimesh 2012/07/30 21:03:51 Docstring plz. This is the text that'll get print
+ tracer = self._tracer_factory.Produce()
+ tracer.BeginTracing()
+ model = tracer.EndTracing()
+ self.assertEqual(1, len(model.FindAllThreadsNamed("CrBrowserMain")))
+
+ def testMultipleTraces(self):
+ tracer = self._tracer_factory.Produce()
+ tracer.BeginTracing()
+ model1 = tracer.EndTracing()
+ tracer.BeginTracing()
+ model2 = tracer.EndTracing()
+ del tracer
+ self.assertEqual(1, len(model1.FindAllThreadsNamed("CrBrowserMain")))
Nirnimesh 2012/07/30 21:03:51 use ' instead of "
+ self.assertEqual(1, len(model2.FindAllThreadsNamed("CrBrowserMain")))
+
+ def testMultipleTracers(self):
+ tracer1 = self._tracer_factory.Produce()
+ tracer2 = self._tracer_factory.Produce()
+ del self._tracer_factory
+ # I don't know what will happen if you try to nest calls to beginTracing.
+ tracer1.BeginTracing()
+ model1 = tracer1.EndTracing()
+ del tracer1
+ tracer2.BeginTracing()
+ model2 = tracer2.EndTracing()
+ del tracer2
+ self.assertEqual(1, len(model1.FindAllThreadsNamed("CrBrowserMain")))
+ del model1
+ self.assertEqual(1, len(model2.FindAllThreadsNamed("CrBrowserMain")))
+ del model2
+
Nirnimesh 2012/07/30 21:03:51 add another blank line here
+if __name__ == '__main__':
+ pyauto_tracing.Main()
« chrome/test/functional/tracing/tracer.py ('K') | « chrome/test/functional/tracing/tracer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698