Bug 1189162 - Clamp gamepad.timestamp and VideoPlaybackQuality.creationTime. r=bz

This commit is contained in:
Hiroyuki Ikezoe 2015-07-30 01:41:00 -04:00
parent 216903e6a8
commit c6d84b5d21
3 changed files with 4 additions and 3 deletions

View File

@ -31,7 +31,7 @@ Gamepad::UpdateTimestamp()
if(newWindow) {
nsPerformance* perf = newWindow->GetPerformance();
if (perf) {
mTimestamp = perf->GetDOMTiming()->TimeStampToDOMHighRes(TimeStamp::Now());
mTimestamp = perf->Now();
}
}
}

View File

@ -213,7 +213,7 @@ HTMLVideoElement::GetVideoPlaybackQuality()
if (window) {
nsPerformance* perf = window->GetPerformance();
if (perf) {
creationTime = perf->GetDOMTiming()->TimeStampToDOMHighRes(TimeStamp::Now());
creationTime = perf->Now();
}
}

View File

@ -19,7 +19,8 @@ var index = GamepadService.addGamepad("test gamepad", // id
2);// axes
GamepadService.newButtonEvent(index, 0, true);
function connecthandler(e) {
ok(e.gamepad.timestamp <= performance.now());
ok(e.gamepad.timestamp <= performance.now(),
"gamepad.timestamp should less than or equal to performance.now()");
is(e.gamepad.index, 0, "correct gamepad index");
is(e.gamepad.id, "test gamepad", "correct gamepad name");
is(e.gamepad.mapping, "standard", "standard mapping");