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

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 more style issues. 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
« no previous file with comments | « chrome/test/functional/tracing/tracer.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2012 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 pyauto_tracing
7 import pyauto
8 import tracer
9
10
11 class TracingSmokeTest(pyauto.PyUITest):
12 """Test basic functionality of the tracing API."""
13 def setUp(self):
14 super(TracingSmokeTest, self).setUp()
15 self._tracer_factory = tracer.TracerFactory(self)
16
17 def testGetData(self):
18 """Check that we can find a CrBrowserMain thread."""
19 tracer = self._tracer_factory.Produce()
20 tracer.BeginTracing()
21 model = tracer.EndTracing()
22 self.assertEqual(1, len(model.FindAllThreadsNamed('CrBrowserMain')))
23
24 def testMultipleTraces(self):
25 """Check that we can run multiple traces on the same tracer."""
26 tracer = self._tracer_factory.Produce()
27 tracer.BeginTracing()
28 model1 = tracer.EndTracing()
29 tracer.BeginTracing()
30 model2 = tracer.EndTracing()
31 del tracer
32 self.assertEqual(1, len(model1.FindAllThreadsNamed('CrBrowserMain')))
33 self.assertEqual(1, len(model2.FindAllThreadsNamed('CrBrowserMain')))
34
35 def testMultipleTracers(self):
36 """Check that we can run multiple traces with multiple tracers."""
37 tracer1 = self._tracer_factory.Produce()
38 tracer2 = self._tracer_factory.Produce()
39 del self._tracer_factory
40 # Nested calls to beginTracing is untested and probably won't work.
41 tracer1.BeginTracing()
42 model1 = tracer1.EndTracing()
43 del tracer1
44 tracer2.BeginTracing()
45 model2 = tracer2.EndTracing()
46 del tracer2
47 self.assertEqual(1, len(model1.FindAllThreadsNamed('CrBrowserMain')))
48 del model1
49 self.assertEqual(1, len(model2.FindAllThreadsNamed('CrBrowserMain')))
50 del model2
51
52
53 if __name__ == '__main__':
54 pyauto_tracing.Main()
OLDNEW
« no previous file with comments | « chrome/test/functional/tracing/tracer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698