Beispiel #1
0
 def testAdjustedAreaDict(self):
   paint_events = speedindex._IncludedPaintEvents(_SAMPLE_EVENTS)
   viewport = 1000, 1000
   time_area_dict = speedindex._TimeAreaDict(paint_events, viewport)
   self.assertEquals(len(time_area_dict), 4)
   # The event that ends at time 100 is a fullscreen; it's discounted by half.
   self.assertEquals(time_area_dict[100], 500000)
   self.assertEquals(time_area_dict[300], 100000)
   self.assertEquals(time_area_dict[400], 200000)
   self.assertEquals(time_area_dict[800], 200000)
Beispiel #2
0
 def testNumberPaintEvents(self):
   # In the sample data, there's one event that occurs before the layout event,
   # and one paint event that's not a leaf paint event.
   events = speedindex._IncludedPaintEvents(_SAMPLE_EVENTS)
   self.assertEquals(len(events), 5)