Index: tools/android/loading/tracing_unittest.py |
diff --git a/tools/android/loading/tracing_unittest.py b/tools/android/loading/tracing_unittest.py |
index 3ad661746e1ae1b58f0f0e42c45559b764c9c8df..5f52af345ab88453542941552f86e2cb6b72aa27 100644 |
--- a/tools/android/loading/tracing_unittest.py |
+++ b/tools/android/loading/tracing_unittest.py |
@@ -8,6 +8,7 @@ import logging |
import operator |
import unittest |
+import clovis_constants |
blundell
2016/06/06 16:06:38
nit: this seems like a minor layering violation. a
pasko
2016/06/06 17:30:52
It does not look like a layering violation to me.
|
import devtools_monitor |
from tracing import (Event, TracingTrack, _IntervalTree) |
@@ -42,7 +43,8 @@ class TracingTrackTestCase(unittest.TestCase): |
def setUp(self): |
self.tree_threshold = _IntervalTree._TRESHOLD |
_IntervalTree._TRESHOLD = 2 # Expose more edge cases in the tree. |
- self.track = TracingTrack(None, additional_categories=('A', 'B', 'C', 'D')) |
+ self.track = TracingTrack(None, |
+ clovis_constants.DEFAULT_CATEGORIES + ['A', 'B', 'C', 'D']) |
gabadie
2016/06/06 16:17:30
Why is it needed to add clovis_constants.DEFAULT_C
pasko
2016/06/06 17:30:52
You are right, this is not needed. Also blundell@
|
def tearDown(self): |
_IntervalTree._TRESHOLD = self.tree_threshold |
@@ -360,26 +362,6 @@ class TracingTrackTestCase(unittest.TestCase): |
self.assertSetEqual( |
set('A'), self.track.Filter(categories=set('A')).Categories()) |
- def testAdditionalCategories(self): |
- track = TracingTrack(None, additional_categories=('best-category-ever',)) |
- self.assertIn('best-category-ever', track.Categories()) |
- # Cannot re-enable a category. |
- with self.assertRaises(AssertionError): |
- TracingTrack(None, additional_categories=('cc',)) |
- # Cannot disable categories via |additional_categories|. |
- with self.assertRaises(AssertionError): |
- TracingTrack(None, additional_categories=('-best-category-ever',)) |
- |
- def testDisabledCategories(self): |
- track = TracingTrack(None, disabled_categories=('toplevel',)) |
- self.assertNotIn('toplevel', track.Categories()) |
- self.assertIn('-toplevel', track.Categories()) |
- # Can only disable categories that are enabled by default. |
- with self.assertRaises(AssertionError): |
- TracingTrack(None, disabled_categories=('best-category-ever',)) |
- with self.assertRaises(AssertionError): |
- TracingTrack(None, disabled_categories=('cc',)) |
- |
def _HandleEvents(self, events): |
self.track.Handle('Tracing.dataCollected', {'params': {'value': [ |
self.EventToMicroseconds(e) for e in events]}}) |