Allow native guide import to complete without plugin-imposed short timeout
This commit is contained in:
@@ -34,6 +34,7 @@ public static class ChannelSyncTests
|
||||
await c.Store.Save(c.SecondOwner.Id,new ChannelPreferences{HiddenIds=new[]{c.OldId.ToString()}},CancellationToken.None);
|
||||
await c.Run();
|
||||
check(c.Executions==1&&c.SourceCalls==1,"changed bouquet invokes native RefreshGuide once without opening a receiver stream");
|
||||
check(c.NativeRuntimePolicy,"full guide import retains native runtime policy without an artificial short timeout");
|
||||
var prefs=await c.Store.Load(c.Owner.Id,CancellationToken.None);
|
||||
check(prefs.FavoriteIds.SequenceEqual(new[]{c.NewId.ToString("N")})&&prefs.HiddenIds.SequenceEqual(new[]{c.NewId.ToString("N")})&&prefs.OrderedIds.SequenceEqual(new[]{c.OtherId.ToString("N"),c.NewId.ToString("N")})&&prefs.DefaultView=="favorites","native channel migration remaps and deduplicates saved favorites, hidden IDs and ordering");
|
||||
check(c.Data[(c.Owner.Id,c.NewId)].IsFavorite&&c.Data[(c.Owner.Id,c.NewId)].PlayCount==7,"native favorite migration preserves existing play history");
|
||||
@@ -95,7 +96,7 @@ public static class ChannelSyncTests
|
||||
public Guid OldId=Guid.NewGuid(),NewId=Guid.NewGuid(),OtherId=Guid.NewGuid();
|
||||
public User Owner=new("sync-owner","test","test"),SecondOwner=new("sync-second","test","test");
|
||||
public ChannelInfo[] Current={new(){Id=SavedChannelPlaybackTests.Current,Name="TV PULS HD",Number="1"}};
|
||||
public BaseItem[] Items;public int Executions,SourceCalls;public bool Fail;
|
||||
public BaseItem[] Items;public int Executions,SourceCalls;public bool Fail,NativeRuntimePolicy;
|
||||
public Dictionary<(Guid,Guid),UserItemData> Data=new();
|
||||
public PreferencesStore Store;public ChannelSyncTask Task;public Worker Worker=new();
|
||||
public TaskCompletionSource Block;public TaskCompletionSource Started=new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
@@ -135,7 +136,7 @@ public static class ChannelSyncTests
|
||||
case "get_Name":return "Enigma2";
|
||||
case "GetChannelsAsync":c.SourceCalls++;return System.Threading.Tasks.Task.FromResult<IEnumerable<ChannelInfo>>(c.Current);
|
||||
case "get_ScheduledTasks":return new IScheduledTaskWorker[]{c.Worker};
|
||||
case "Execute":if(!ReferenceEquals(args[0],c.Worker))throw new Exception("Wrong native task");return c.Execute();
|
||||
case "Execute":if(!ReferenceEquals(args[0],c.Worker))throw new Exception("Wrong native task");c.NativeRuntimePolicy=((TaskOptions)args[1]).MaxRuntimeTicks==null;return c.Execute();
|
||||
case "GetItemList":return c.Items;
|
||||
case "GetUsers":return new[]{c.Owner,c.SecondOwner};
|
||||
case "GetUserDataBatch":
|
||||
|
||||
Reference in New Issue
Block a user