Ejemplo n.º 1
0
 def testCanImportEmptyTimelineData(self):
     # We can import empty lists and empty string wrapped in subclasses of
     # TimelineData
     self.assertTrue(
         empty_timeline_data_importer.EmptyTimelineDataImporter.CanImport(
             tracing_timeline_data.TracingTimelineData([])))
     self.assertTrue(
         empty_timeline_data_importer.EmptyTimelineDataImporter.CanImport(
             tracing_timeline_data.TracingTimelineData('')))
    def testWrite1(self):
        ri = tracing_timeline_data.TracingTimelineData(map(json.loads, []))
        f = cStringIO.StringIO()
        ri.Serialize(f)
        v = f.getvalue()

        j = json.loads(v)
        assert 'traceEvents' in j
        self.assertEquals(j['traceEvents'], [])
 def testBrowserProcess(self):
     ri = tracing_timeline_data.TracingTimelineData(
         map(json.loads, [
             '{"name": "process_name",'
             '"args": {"name": "Browser"},'
             '"pid": 5, "ph": "M"}', '{"name": "thread_name",'
             '"args": {"name": "CrBrowserMain"},'
             '"pid": 5, "tid": 32578, "ph": "M"}'
         ]))
     model = TimelineModel(ri)
     self.assertEquals(model.browser_process.pid, 5)
Ejemplo n.º 4
0
 def _GetTraceResult(self):
     assert not self.is_tracing_running
     return tracing_timeline_data.TracingTimelineData(
         self._tracing_data, self._tab_to_marker_mapping)
Ejemplo n.º 5
0
 def testCannotImportNonEmptyTimelineData(self):
     # We can't import non-empty TimelineData objects
     self.assertFalse(
         empty_timeline_data_importer.EmptyTimelineDataImporter.CanImport(
             tracing_timeline_data.TracingTimelineData([1, 2, 3])))
Ejemplo n.º 6
0
 def testEmptyImport(self):
   model.TimelineModel(
       tracing_timeline_data.TracingTimelineData([]))
   model.TimelineModel(
       tracing_timeline_data.TracingTimelineData(''))