From 8fec151f51ae82f343052a99be8dbb6e6e6051c0 Mon Sep 17 00:00:00 2001 From: Teemu Tapanila Date: Sun, 21 Jul 2024 00:46:56 +0300 Subject: [PATCH] Fixed website loading test --- Sharpcaster.Test/ChromecastApplicationTester.cs | 16 +++++++++------- Sharpcaster.Test/customMessage/webMessage.cs | 2 +- Sharpcaster/ChromeCastClient.cs | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Sharpcaster.Test/ChromecastApplicationTester.cs b/Sharpcaster.Test/ChromecastApplicationTester.cs index d6e9479..9c373df 100644 --- a/Sharpcaster.Test/ChromecastApplicationTester.cs +++ b/Sharpcaster.Test/ChromecastApplicationTester.cs @@ -116,21 +116,23 @@ public async Task ConnectToChromecastAndLaunchApplicationOnceAndJoinIt(Chromecas Assert.Equal(firstLaunchTransportId, status.Application.TransportId); } - //Seems like this isn't really working anymore and just loading a white screen - [Fact(Skip = "Seems like this isn't really working anymore and just loading a white screen")] - public async Task ConnectToChromecastAndLaunchWebPage() + [Theory] + [MemberData(nameof(ChromecastReceiversFilter.GetChromecastUltra), MemberType = typeof(ChromecastReceiversFilter))] + public async Task ConnectToChromecastAndLaunchWebPage(ChromecastReceiver receiver) { var TestHelper = new TestHelper(); - var client = await TestHelper.CreateConnectAndLoadAppClient(output, "5CB45E5A"); + var client = await TestHelper.CreateConnectAndLoadAppClient(output, receiver, "F7FD2183"); var req = new WebMessage { - Type = "loc", - Url = "https://www.google.com/" + Url = "https://mallow.fi/", + Type = "load", + SessionId = client.GetChromecastStatus().Application.SessionId }; - await client.SendAsync(null, "urn:x-cast:com.url.cast", req, "receiver-0"); + await client.SendAsync(null, "urn:x-cast:com.boombatower.chromecast-dashboard", req, client.GetChromecastStatus().Application.SessionId); + await Task.Delay(5000); } } } diff --git a/Sharpcaster.Test/customMessage/webMessage.cs b/Sharpcaster.Test/customMessage/webMessage.cs index 8ee119f..ee52592 100644 --- a/Sharpcaster.Test/customMessage/webMessage.cs +++ b/Sharpcaster.Test/customMessage/webMessage.cs @@ -4,7 +4,7 @@ namespace Sharpcaster.Test.customChannel { [DataContract] - public class WebMessage : MessageWithId + internal class WebMessage : MessageWithSession { [DataMember(Name = "url")] public string Url { get; set; } diff --git a/Sharpcaster/ChromeCastClient.cs b/Sharpcaster/ChromeCastClient.cs index 34c4cb5..926e614 100644 --- a/Sharpcaster/ChromeCastClient.cs +++ b/Sharpcaster/ChromeCastClient.cs @@ -344,7 +344,7 @@ public async Task LaunchApplicationAsync(string applicationId, } } var newApplication = await GetChannel().LaunchApplicationAsync(applicationId); - await GetChannel().ConnectAsync(newApplication.Applications.First().TransportId); + await GetChannel().ConnectAsync(newApplication.Application.TransportId); return await GetChannel().GetChromecastStatusAsync(); }