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

Unified Diff: tracing/tracing/value/histogram_set_unittest.py

Issue 3009553002: Refactor Histogram relationship diagnostics. (Closed)
Patch Set: Created 3 years, 3 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
« no previous file with comments | « tracing/tracing/value/histogram_set_test.html ('k') | tracing/tracing/value/histogram_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/value/histogram_set_unittest.py
diff --git a/tracing/tracing/value/histogram_set_unittest.py b/tracing/tracing/value/histogram_set_unittest.py
index 2844858ae42e887f357daa08ce4373fa4cb14a2f..96d560d5275d72d00884b154a5539ad72af0e812 100644
--- a/tracing/tracing/value/histogram_set_unittest.py
+++ b/tracing/tracing/value/histogram_set_unittest.py
@@ -11,53 +11,6 @@ from tracing.value.diagnostics import diagnostic_ref
class HistogramSetUnittest(unittest.TestCase):
- def testRelatedHistogramMap(self):
- a = histogram.Histogram('a', 'unitless')
- b = histogram.Histogram('b', 'unitless')
- c = histogram.Histogram('c', 'unitless')
- rhm = histogram.RelatedHistogramMap()
- rhm.Set('y', b)
- rhm.Set('z', c)
- a.diagnostics['rhm'] = rhm
-
- # Don't serialize c yet.
- hists = histogram_set.HistogramSet([a, b])
- hists2 = histogram_set.HistogramSet()
- hists2.ImportDicts(hists.AsDicts())
- hists2.ResolveRelatedHistograms()
- a2 = hists2.GetHistogramsNamed('a')
- self.assertEqual(len(a2), 1)
- a2 = a2[0]
- self.assertEqual(a2.guid, a.guid)
- self.assertIsInstance(a2, histogram.Histogram)
- self.assertIsNot(a2, a)
- b2 = hists2.GetHistogramsNamed('b')
- self.assertEqual(len(b2), 1)
- b2 = b2[0]
- self.assertEqual(b2.guid, b.guid)
- self.assertIsInstance(b2, histogram.Histogram)
- self.assertIsNot(b2, b)
- rhm2 = a2.diagnostics['rhm']
- self.assertIsInstance(rhm2, histogram.RelatedHistogramMap)
- self.assertEqual(len(rhm2), 2)
-
- # Assert that b and c are in a2's RelatedHistogramMap, rhm2.
- self.assertIs(b2, rhm2.Get('y'))
- self.assertIsInstance(rhm2.Get('z'), histogram.HistogramRef)
-
- # Now serialize c and add it to hists2.
- hists2.ImportDicts([c.AsDict()])
- hists2.ResolveRelatedHistograms()
-
- c2 = hists2.GetHistogramsNamed('c')
- self.assertEqual(len(c2), 1)
- c2 = c2[0]
- self.assertEqual(c2.guid, c.guid)
- self.assertIsNot(c2, c)
-
- self.assertIs(b2, rhm2.Get('y'))
- self.assertIs(c2, rhm2.Get('z'))
-
def testGetSharedDiagnosticsOfType(self):
d0 = histogram.GenericSet(['foo'])
d1 = histogram.DateRange(0)
« no previous file with comments | « tracing/tracing/value/histogram_set_test.html ('k') | tracing/tracing/value/histogram_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698