-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate handlertestbase (#11021)
* Consolidate HandlerTestBase code * - remove classes from blazor tests * - register correct ApplicationStub * - use default mauiprogram * - move stubs back * - move more stubs back * - remove frame related fix updates * - fix viewhandler * Update ViewHandler.cs * - move all core specific tests to new project * - add shared to blazor tests * - fix build errors * - comment out Tizen * - fix font registration * - scope dokdo registration to test * - just set WxH if measure are still infinity * - comment out search bar tests
- Loading branch information
Showing
145 changed files
with
866 additions
and
784 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 0 additions & 56 deletions
56
src/BlazorWebView/tests/MauiDeviceTests/Stubs/ContextStub.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/Controls/tests/DeviceTests/ControlsDeviceTestExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Controls.Hosting; | ||
using Microsoft.Maui.DeviceTests.Stubs; | ||
using Microsoft.Maui.Handlers; | ||
using Microsoft.Maui.Hosting; | ||
using Microsoft.Maui.LifecycleEvents; | ||
using Xunit; | ||
#if ANDROID || IOS || MACCATALYST | ||
using ShellHandler = Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer; | ||
#endif | ||
|
||
namespace Microsoft.Maui.DeviceTests | ||
{ | ||
public static class ControlsDeviceTestExtensions | ||
{ | ||
public static MauiAppBuilder ConfigureTestBuilder(this MauiAppBuilder mauiAppBuilder) | ||
{ | ||
return | ||
mauiAppBuilder | ||
.RemapForControls() | ||
.ConfigureLifecycleEvents(lifecycle => | ||
{ | ||
#if IOS || MACCATALYST | ||
lifecycle | ||
.AddiOS(iOS => iOS | ||
.OpenUrl((app, url, options) => | ||
ApplicationModel.Platform.OpenUrl(app, url, options)) | ||
.ContinueUserActivity((application, userActivity, completionHandler) => | ||
ApplicationModel.Platform.ContinueUserActivity(application, userActivity, completionHandler)) | ||
.PerformActionForShortcutItem((application, shortcutItem, completionHandler) => | ||
ApplicationModel.Platform.PerformActionForShortcutItem(application, shortcutItem, completionHandler))); | ||
#elif WINDOWS | ||
lifecycle | ||
.AddWindows(windows => | ||
{ | ||
windows | ||
.OnLaunched((app, e) => | ||
ApplicationModel.Platform.OnLaunched(e)); | ||
windows | ||
.OnActivated((window, e) => | ||
ApplicationModel.Platform.OnActivated(window, e)); | ||
}); | ||
#endif | ||
}) | ||
.ConfigureMauiHandlers(handlers => | ||
{ | ||
handlers.AddHandler(typeof(Editor), typeof(EditorHandler)); | ||
handlers.AddHandler(typeof(VerticalStackLayout), typeof(LayoutHandler)); | ||
handlers.AddHandler(typeof(Controls.Window), typeof(WindowHandlerStub)); | ||
handlers.AddHandler(typeof(Controls.ContentPage), typeof(PageHandler)); | ||
handlers.AddHandler(typeof(MauiAppNewWindowStub), typeof(ApplicationHandler)); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.