* Run unit tests that create a UI dispatcher in a scope
Seventy-two Avalonia.Base.UnitTests classes create Dispatcher.UIThread
without ScopedTestBase or UnitTestApplication and never release it, and
TestWithServicesBase, the base of two more, creates one while disposing. The
dispatcher stays bound to the thread that created it; tests run one at a time
but not on one thread, so when the next test lands on another thread
bindings post their values instead of publishing them and whole classes such
as BindingExpressionTests and SetterTests fail.
- Derive those classes from ScopedTestBase, which resets the dispatcher and
the locator around every test.
- Move GlyphRunTests and DiagnosticTextRendererTests from TestWithServicesBase
to ScopedTestBase and delete TestWithServicesBase, which only scoped the
locator.
* Add failing tests for VerifyEmptyDispatcherAfterTest leak detection
An unscoped test that leaves Dispatcher.UIThread behind passes today and
breaks whichever test next runs on another thread. The attribute's own check
also creates a UI dispatcher after tests that never touched one.
* Fail unscoped tests that leave a UI dispatcher behind
VerifyEmptyDispatcherAfterTest only checked for leftover jobs, so a test that
created Dispatcher.UIThread outside ScopedTestBase or UnitTestApplication
passed and broke whichever test next ran on another thread. Its own check
also created a UI dispatcher after tests that never touched one.
- Look the dispatcher up with TryGetUIThread instead of creating one.
- Fail when an unscoped test leaves a UI dispatcher, listing any leftover
jobs as before, and release it so the failure stays with that test.
* Add BringIntoView pass to the LayoutManager
* Make ProcessBringIntoViewRequests part of the standard layout pass
* Clarify why TryScrollIntoViewNow's result is ignored
---------
Co-authored-by: grokys <grokys@users.noreply.github.com>
* Add unit test for styling affecting measurements in WindowDrawnDecorationsContent
* Refactor layout measurement to apply styling before visibility checks
* Add core measure test
* Add StackPanel test
* Call ApplyStyling unconditionally in MeasureCore
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Update to xunit.v3
* Little more progress
* More fixes
* Keep VSTest supported
* Adjust Nuke
* Few fixes
* Fix for xunit 2
* Fix GetData override
* Adjust
* Use MTP for xunit 2
* Fix test
* Better fix
* --no-progress
* Few more fixes
* no progress
* Fix test
* Better fix
* TRX
* Move to Directory.Build.props
* Unify on MTP v2
* Update
* Update to stable
* 1.0.1
* 1.0.2
* Fix some warnings
* Fix more warnings
* Fix more warnings
* Enable nullability in UnitTests
* Enable nullability in Base.UnitTests
* Enable nullability in Markup.UnitTests
* Enable nullability in Markup.Xaml.UnitTests
* add unit tests to show that the EffectiveViewPortChanged event is not being raised when it should.
note: this tests are verified against UWP behavior.
* fix raising of EffectiveViewPortChanged event.
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
Co-authored-by: Max Katz <maxkatz6@outlook.com>
- animation/layout/render cycle is now managed from a central location
- animations are now throttled if animation/layout/render pass takes longer than a frame which previously caused a soft-freeze with input not being processed
- the public API is trimmed to make sure that we can make other planned changes during the 11.x support cycle
"Changelog":
- IClock is hidden and is planned to be replaced later
- Animator classes are hidden and are planned to be refactored later
- IAnimation members are hidden, it's supposed to be a marker interface for Style.Animations collection now, to start animations manually use Animation.RunAsync
- Sealed several classes in Avalonia.Animation namespace
- Spring class is removed from the public API (it wasn't possible to use it directly in a meaningful way anyway)
- Sealed brushes, transforms, effects and drawings
- Removed separate dispatcher priorities for Layout and Composition, everything now happens from a central place with Render priority (same as WPF)
- - some private "hook" priorities are added for now, those will be removed later
- IRenderLoop is hidden and removed from locator
- IRenderer is hidden (the plan is to remove that concept later)
- - Renderer.Start/Stop exposed as StartRendering/StopRendering on the toplevel (will be on a CompositionTarget/PresentationSource-like type later)
- - Renderer.Diagnistics exposed as RendererDiagnostics (same)
- - Renderer is no longer created by the platform code and is created by TopLevel itself
- - From the user-code hit-testing should be done by VisualExtensions.GetVisual(s)At, which has the same features
- - For unit tests a separate IHitTester interface is added which can be changed for a particular toplevel
- ILayoutManager is hidden
- - LayoutManager.ExecuteLayoutPass() exposed as TopLevel.UpdateLayout()
- Custom animators now have a separate base class that only deals with interpolation
Minor improvements:
- Compositor has a mode that doesn't use DispatcherTimers, useful for unit tests
- Introduced ScopedTestBase that auto-resets the locator when test is finished
Fixes for #8092:
- Always round sizes up, not to the nearest pixel, thereby ensuring that `DesiredSize`s don't get rounded down where possible.
- Apply rounding to `Padding` and `BorderThickness` in measure pass as well as arrange pass, to ensure that `DesiredSize` takes this rounding into account.
* Merge core libraries.
Everything below `Avalonia.Controls` into `Avalonia.Base`.
* Move new files to correct place.
* Removed unused dirs/projects,
* Removed outdated references from theme assemblies.
* Merge unit tests to match new assembly layout.
* Fixup test namespaces.
* Make directory match namespace.
* Move files to match namespace.
* Move files to match namespace.
* Fix up incorrect namespace.
`Avalonia.Visuals.Media.Imaging` -> `Avalonia.Media.Imaging`.
* Fix resource URL.
* Removed outdated dependencies.
* Added missing project reference.
* Update test namespaces.
* Fix merge error.
* Fix merge errors.
* Fix bad merge in WindowsInteropTest.csproj.
* Fix up merge errors in csprojs.
* Remove merged tests from nuke.
* Fix up namespace.
* Fix compile error.
* Fix failing tests.
Now that more unit tests are present in Avalonia.Base.UnitTests, general `AvaloniaObject` properties are getting registered. Ignore those.
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>