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

Unified Diff: tools/android/loading/tracing_unittest.py

Issue 2047463002: Set tracing categories explicitly in Clovis and Sandwich (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: 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]}})
« tools/android/loading/sandwich_runner.py ('K') | « tools/android/loading/tracing.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698