|
|
@ -23,9 +23,7 @@ namespace Avalonia.UnitTests |
|
|
assetLoader: new AssetLoader(), |
|
|
assetLoader: new AssetLoader(), |
|
|
layoutManager: new LayoutManager(), |
|
|
layoutManager: new LayoutManager(), |
|
|
platform: new AppBuilder().RuntimePlatform, |
|
|
platform: new AppBuilder().RuntimePlatform, |
|
|
renderer: (_, __) => Mock.Of<IRenderer>(), |
|
|
|
|
|
renderInterface: new MockPlatformRenderInterface(), |
|
|
renderInterface: new MockPlatformRenderInterface(), |
|
|
renderLoop: Mock.Of<IRenderLoop>(), |
|
|
|
|
|
standardCursorFactory: Mock.Of<IStandardCursorFactory>(), |
|
|
standardCursorFactory: Mock.Of<IStandardCursorFactory>(), |
|
|
styler: new Styler(), |
|
|
styler: new Styler(), |
|
|
theme: () => CreateDefaultTheme(), |
|
|
theme: () => CreateDefaultTheme(), |
|
|
@ -47,9 +45,6 @@ namespace Avalonia.UnitTests |
|
|
public static readonly TestServices MockWindowingPlatform = new TestServices( |
|
|
public static readonly TestServices MockWindowingPlatform = new TestServices( |
|
|
windowingPlatform: new MockWindowingPlatform()); |
|
|
windowingPlatform: new MockWindowingPlatform()); |
|
|
|
|
|
|
|
|
public static readonly TestServices RealDeferredRenderer = new TestServices( |
|
|
|
|
|
renderer: (root, loop) => new DeferredRenderer(root, loop)); |
|
|
|
|
|
|
|
|
|
|
|
public static readonly TestServices RealFocus = new TestServices( |
|
|
public static readonly TestServices RealFocus = new TestServices( |
|
|
focusManager: new FocusManager(), |
|
|
focusManager: new FocusManager(), |
|
|
keyboardDevice: () => new KeyboardDevice(), |
|
|
keyboardDevice: () => new KeyboardDevice(), |
|
|
@ -71,7 +66,6 @@ namespace Avalonia.UnitTests |
|
|
ILayoutManager layoutManager = null, |
|
|
ILayoutManager layoutManager = null, |
|
|
Func<IMouseDevice> mouseDevice = null, |
|
|
Func<IMouseDevice> mouseDevice = null, |
|
|
IRuntimePlatform platform = null, |
|
|
IRuntimePlatform platform = null, |
|
|
Func<IRenderRoot, IRenderLoop, IRenderer> renderer = null, |
|
|
|
|
|
IPlatformRenderInterface renderInterface = null, |
|
|
IPlatformRenderInterface renderInterface = null, |
|
|
IRenderLoop renderLoop = null, |
|
|
IRenderLoop renderLoop = null, |
|
|
IScheduler scheduler = null, |
|
|
IScheduler scheduler = null, |
|
|
@ -79,6 +73,7 @@ namespace Avalonia.UnitTests |
|
|
IStyler styler = null, |
|
|
IStyler styler = null, |
|
|
Func<Styles> theme = null, |
|
|
Func<Styles> theme = null, |
|
|
IPlatformThreadingInterface threadingInterface = null, |
|
|
IPlatformThreadingInterface threadingInterface = null, |
|
|
|
|
|
IWindowImpl windowImpl = null, |
|
|
IWindowingPlatform windowingPlatform = null) |
|
|
IWindowingPlatform windowingPlatform = null) |
|
|
{ |
|
|
{ |
|
|
AssetLoader = assetLoader; |
|
|
AssetLoader = assetLoader; |
|
|
@ -89,14 +84,13 @@ namespace Avalonia.UnitTests |
|
|
LayoutManager = layoutManager; |
|
|
LayoutManager = layoutManager; |
|
|
MouseDevice = mouseDevice; |
|
|
MouseDevice = mouseDevice; |
|
|
Platform = platform; |
|
|
Platform = platform; |
|
|
Renderer = renderer; |
|
|
|
|
|
RenderInterface = renderInterface; |
|
|
RenderInterface = renderInterface; |
|
|
RenderLoop = renderLoop; |
|
|
|
|
|
Scheduler = scheduler; |
|
|
Scheduler = scheduler; |
|
|
StandardCursorFactory = standardCursorFactory; |
|
|
StandardCursorFactory = standardCursorFactory; |
|
|
Styler = styler; |
|
|
Styler = styler; |
|
|
Theme = theme; |
|
|
Theme = theme; |
|
|
ThreadingInterface = threadingInterface; |
|
|
ThreadingInterface = threadingInterface; |
|
|
|
|
|
WindowImpl = windowImpl; |
|
|
WindowingPlatform = windowingPlatform; |
|
|
WindowingPlatform = windowingPlatform; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -108,14 +102,13 @@ namespace Avalonia.UnitTests |
|
|
public ILayoutManager LayoutManager { get; } |
|
|
public ILayoutManager LayoutManager { get; } |
|
|
public Func<IMouseDevice> MouseDevice { get; } |
|
|
public Func<IMouseDevice> MouseDevice { get; } |
|
|
public IRuntimePlatform Platform { get; } |
|
|
public IRuntimePlatform Platform { get; } |
|
|
public Func<IRenderRoot, IRenderLoop, IRenderer> Renderer { get; } |
|
|
|
|
|
public IPlatformRenderInterface RenderInterface { get; } |
|
|
public IPlatformRenderInterface RenderInterface { get; } |
|
|
public IRenderLoop RenderLoop { get; } |
|
|
|
|
|
public IScheduler Scheduler { get; } |
|
|
public IScheduler Scheduler { get; } |
|
|
public IStandardCursorFactory StandardCursorFactory { get; } |
|
|
public IStandardCursorFactory StandardCursorFactory { get; } |
|
|
public IStyler Styler { get; } |
|
|
public IStyler Styler { get; } |
|
|
public Func<Styles> Theme { get; } |
|
|
public Func<Styles> Theme { get; } |
|
|
public IPlatformThreadingInterface ThreadingInterface { get; } |
|
|
public IPlatformThreadingInterface ThreadingInterface { get; } |
|
|
|
|
|
public IWindowImpl WindowImpl { get; } |
|
|
public IWindowingPlatform WindowingPlatform { get; } |
|
|
public IWindowingPlatform WindowingPlatform { get; } |
|
|
|
|
|
|
|
|
public TestServices With( |
|
|
public TestServices With( |
|
|
@ -127,7 +120,6 @@ namespace Avalonia.UnitTests |
|
|
ILayoutManager layoutManager = null, |
|
|
ILayoutManager layoutManager = null, |
|
|
Func<IMouseDevice> mouseDevice = null, |
|
|
Func<IMouseDevice> mouseDevice = null, |
|
|
IRuntimePlatform platform = null, |
|
|
IRuntimePlatform platform = null, |
|
|
Func<IRenderRoot, IRenderLoop, IRenderer> renderer = null, |
|
|
|
|
|
IPlatformRenderInterface renderInterface = null, |
|
|
IPlatformRenderInterface renderInterface = null, |
|
|
IRenderLoop renderLoop = null, |
|
|
IRenderLoop renderLoop = null, |
|
|
IScheduler scheduler = null, |
|
|
IScheduler scheduler = null, |
|
|
@ -147,15 +139,14 @@ namespace Avalonia.UnitTests |
|
|
layoutManager: layoutManager ?? LayoutManager, |
|
|
layoutManager: layoutManager ?? LayoutManager, |
|
|
mouseDevice: mouseDevice ?? MouseDevice, |
|
|
mouseDevice: mouseDevice ?? MouseDevice, |
|
|
platform: platform ?? Platform, |
|
|
platform: platform ?? Platform, |
|
|
renderer: renderer ?? Renderer, |
|
|
|
|
|
renderInterface: renderInterface ?? RenderInterface, |
|
|
renderInterface: renderInterface ?? RenderInterface, |
|
|
renderLoop: renderLoop ?? RenderLoop, |
|
|
|
|
|
scheduler: scheduler ?? Scheduler, |
|
|
scheduler: scheduler ?? Scheduler, |
|
|
standardCursorFactory: standardCursorFactory ?? StandardCursorFactory, |
|
|
standardCursorFactory: standardCursorFactory ?? StandardCursorFactory, |
|
|
styler: styler ?? Styler, |
|
|
styler: styler ?? Styler, |
|
|
theme: theme ?? Theme, |
|
|
theme: theme ?? Theme, |
|
|
threadingInterface: threadingInterface ?? ThreadingInterface, |
|
|
threadingInterface: threadingInterface ?? ThreadingInterface, |
|
|
windowingPlatform: windowingPlatform ?? WindowingPlatform); |
|
|
windowingPlatform: windowingPlatform ?? WindowingPlatform, |
|
|
|
|
|
windowImpl: windowImpl ?? WindowImpl); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private static Styles CreateDefaultTheme() |
|
|
private static Styles CreateDefaultTheme() |
|
|
|