From 6ffdaebf1c24e21bb7cbd3da6a848629dfc49944 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Thu, 14 Apr 2016 11:50:32 -0700 Subject: [PATCH] Make external asset tests a little more flexible The toBeCloseTo matcher on currentTime was too strict, so I added a tolerance of 0.1 seconds. This fixes some test failures on various browsers and platforms. Change-Id: I0438d7a06be3c1e20c5cd4170f02213c63d58e85 --- test/player_integration.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/player_integration.js b/test/player_integration.js index c6dcf30dda..f195ed37a9 100644 --- a/test/player_integration.js +++ b/test/player_integration.js @@ -181,7 +181,7 @@ describe('Player', function() { return waitForTimeOrEnd(video, 30); }).then(function() { if (video.ended) { - expect(video.currentTime).toBeCloseTo(video.duration); + expect(video.currentTime).toBeCloseTo(video.duration, 0.1); } else { expect(video.currentTime).toBeGreaterThan(20); // If it were very close to duration, why !video.ended? @@ -193,7 +193,7 @@ describe('Player', function() { // 30 seconds or video ended, whichever comes first. return waitForTimeOrEnd(video, 30).then(function() { expect(video.ended).toBe(true); - expect(video.currentTime).toBeCloseTo(video.duration); + expect(video.currentTime).toBeCloseTo(video.duration, 0.1); }); } }