cobalt - Test case maxGranularityPlaybackRate random fail -


dears:

youtube need pass following test case:

  1. maxgranularityplaybackrate0.25
  2. maxgranularityplaybackrate0.50
  3. maxgranularityplaybackrate1.00
  4. maxgranularityplaybackrate1.25
  5. maxgranularityplaybackrate1.50
  6. maxgranularityplaybackrate2.00

it seems following code in test case check max timeupdate event interval, less 260ms required:

    if (times !== 0) {       var interval = date.now() - last;       if (interval > maxgranularity)         maxgranularity = interval;     }     if (times === 50) {       maxgranularity = maxgranularity / 1000.0;       test.prototype.status = util.round(maxgranularity, 2);       runner.checkle(maxgranularity, 0.26, 'maxgranularity');       runner.succeed();     } 

i found timeupdate event notify web app every 250ms in cobalt src/cobalt/dom/html_media_element.cc:

const double htmlmediaelement::**kmaxtimeupdateeventfrequency** = 0.25; 

and

playback_progress_timer_.start(   from_here, base::timedelta::frommilliseconds(                  static_cast<int64>(kmaxtimeupdateeventfrequency * 1000)),   this, &htmlmediaelement::onplaybackprogresstimer); 

however, following check in onplaybackprogresstimer cause random fail:

if (periodic_event && time_delta < kmaxtimeupdateeventfrequency) { return; 

}

on side, sometimes time_delta 0.249995 less 0.25. cobalt not send timeupdate event web page, , test case 499ms max timeupdate event interval cause these test cases random fail.

maybe need check time_delta < (kmaxtimeupdateeventfrequency - 0.01) or similar method.


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -