Beispiel #1
0
  def testOneFrameDelta(self):
    timestamps = self._CreateUniformTimestamps(0, 10, self.refresh_period)
    results = self._CreateDictionaryFromResults(
                  SurfaceStatsCollector._CalculateResults(
                      self.refresh_period, timestamps, ''))

    self.assertEquals(results['avg_surface_fps'].value,
                      int(round(1 / self.refresh_period)))
    self.assertEquals(results['jank_count'].value, 0)
    self.assertEquals(results['max_frame_delay'].value, 1)
    self.assertEquals(len(results['frame_lengths'].value), len(timestamps) - 1)
    def testSomeFramesTooShort(self):
        timestamps = self._CreateUniformTimestamps(0, 5, self.refresh_period)
        # The following timestamps should be skipped.
        timestamps += self._CreateUniformTimestamps(timestamps[4], 5,
                                                    self.refresh_period / 100)
        timestamps += self._CreateUniformTimestamps(timestamps[4], 5,
                                                    self.refresh_period)

        results = self._CreateDictionaryFromResults(
            SurfaceStatsCollector._CalculateResults(self.refresh_period,
                                                    timestamps, ''))

        self.assertEquals(len(results['frame_lengths'].value), 9)
  def testSomeFramesTooShort(self):
    timestamps = self._CreateUniformTimestamps(0, 5, self.refresh_period)
    # The following timestamps should be skipped.
    timestamps += self._CreateUniformTimestamps(timestamps[4],
                                                5,
                                                self.refresh_period / 100)
    timestamps += self._CreateUniformTimestamps(timestamps[4],
                                                5,
                                                self.refresh_period)

    results = self._CreateDictionaryFromResults(
                  SurfaceStatsCollector._CalculateResults(
                      self.refresh_period, timestamps, ''))

    self.assertEquals(len(results['frame_lengths'].value), 9)