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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import unittest
7
8 import pyauto_tracing
9 import pyauto
10 import tracer
11
Nirnimesh 2012/07/30 21:03:51 Need 2 blank lines at global scope
12 class TracingSmokeTest(pyauto.PyUITest):
Nirnimesh 2012/07/30 21:03:51 Docstring please
13 def setUp(self):
14 super(TracingSmokeTest, self).setUp()
15 self._tracer_factory = tracer.TracerFactory(self)
16
17 def testGetData(self):
Nirnimesh 2012/07/30 21:03:51 Docstring plz. This is the text that'll get print
18 tracer = self._tracer_factory.Produce()
19 tracer.BeginTracing()
20 model = tracer.EndTracing()
21 self.assertEqual(1, len(model.FindAllThreadsNamed("CrBrowserMain")))
22
23 def testMultipleTraces(self):
24 tracer = self._tracer_factory.Produce()
25 tracer.BeginTracing()
26 model1 = tracer.EndTracing()
27 tracer.BeginTracing()
28 model2 = tracer.EndTracing()
29 del tracer
30 self.assertEqual(1, len(model1.FindAllThreadsNamed("CrBrowserMain")))
Nirnimesh 2012/07/30 21:03:51 use ' instead of "
31 self.assertEqual(1, len(model2.FindAllThreadsNamed("CrBrowserMain")))
32
33 def testMultipleTracers(self):
34 tracer1 = self._tracer_factory.Produce()
35 tracer2 = self._tracer_factory.Produce()
36 del self._tracer_factory
37 # I don't know what will happen if you try to nest calls to beginTracing.
38 tracer1.BeginTracing()
39 model1 = tracer1.EndTracing()
40 del tracer1
41 tracer2.BeginTracing()
42 model2 = tracer2.EndTracing()
43 del tracer2
44 self.assertEqual(1, len(model1.FindAllThreadsNamed("CrBrowserMain")))
45 del model1
46 self.assertEqual(1, len(model2.FindAllThreadsNamed("CrBrowserMain")))
47 del model2
48
Nirnimesh 2012/07/30 21:03:51 add another blank line here
49 if __name__ == '__main__':
50 pyauto_tracing.Main()
OLDNEW
« 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