Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity 2019 Fixes #86

Merged
merged 4 commits into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions Assets/Tests/Unit/VimeoVideoTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ public void GetDashUrl_Works_For_Play_Response()
}

[Test]
// TODO somehow test different application platforms
// Note: this fails (correctly) when testing on Mac
public void GetAdaptiveVideoFileURL_Returns_Dash_By_Default()
public void GetAdaptiveVideoFileURL_Returns_Correct_Adaptive_Manifest_Based_On_Platform()
{
Assert.AreEqual(video.GetAdaptiveVideoFileURL(), video.getDashUrl());
if (isApple()) {
Assert.AreEqual(video.GetAdaptiveVideoFileURL(), video.getHlsUrl());
} else {
Assert.AreEqual(video.GetAdaptiveVideoFileURL(), video.getDashUrl());
}
}

[Test]
Expand All @@ -135,20 +137,19 @@ public void GetDashUrl_Returns_Null_For_Files_Response()
Assert.AreEqual(video.getDashUrl(), null);
}

[Test]
// TODO somehow test different application platforms
// Note: this fails (correctly) when testing on Mac
public void GetAdaptiveVideoFileURL_Defaults_To_Hls_For_Files_Response()
{
UnityEngine.TestTools.LogAssert.Expect(LogType.Warning, "[Vimeo] No DASH manfiest found. Defaulting to HLS.");
video = new VimeoVideo(JSONNode.Parse(mockProductionJson));
Assert.AreEqual(video.GetAdaptiveVideoFileURL(), video.getHlsUrl());
}
#endregion

[TearDown]
public void _After()
{

}

public bool isApple()
{
return Application.platform == RuntimePlatform.OSXPlayer ||
Application.platform == RuntimePlatform.OSXEditor ||
Application.platform == RuntimePlatform.IPhonePlayer ||
Application.platform == RuntimePlatform.tvOS;
}
}
Loading