Figure out how to test our .xaml classes #5606

Closed
opened 2026-01-31 00:17:16 +00:00 by claunia · 0 comments
Owner

Originally created by @zadjii-msft on GitHub (Dec 17, 2019).

We've made some great progress on testing recently. However, the TabTests are still incapable of creating types that user their own XAML file. Case in point here is TerminalPage. It fails when we attempt to InitializeComponent, because xaml attempts to load ms-appx:///TerminalApp/TerminalPage.xaml. I'm not really sure at the moment why that's not able to be loaded.

I do know that we're not using the resources.pri file here for this test. I've tried manually generating a resources.pri using a lightly modified version of CascadiaPackage's priconfig.xml and the following commands:

makepri new  /mn TerminalApp.LocalTests.AppxManifest.xml /pr . /cf mypriconfig4.xml /verbose /o
makepri dump /if resources.pri /of resources.xml /o

However, if I do that directly, then the App.xbf gets stuck into the resources.pri with the files we do need, which causes the test to explode again.

I tried manually moving the following files to a TerminalApp subdir of , and adding them to filtered.layout.resfiles. That got them into Files/TerminalApp in the resources.pri file, but didn't fix the loading issue. Seemed like they only had their paths added, not the files themselves.

TerminalApp\MinMaxCloseControl.xbf
TerminalApp\TabRowControl.xbf
TerminalApp\TerminalPage.xbf
TerminalApp\TitlebarControl.xbf

I also tried just not compiling App.xaml/idl/h/cpp as a part of TerminalAppLib.vcxproj, and still just including the ...\x64\Debug\TerminalAppLib\TerminalApp.pri line in pri.resfiles. This placed the TerminalApp .xbf files in the right place, without the App.xbf, but it still failed to parse TerminalPage.xaml. I was hoping that I could just move App.xaml to it's own project, and get rd of a bunch of this chaos. Unfortunately, this did not work.

I don't have any ideas how to fix this at the moment.

Originally created by @zadjii-msft on GitHub (Dec 17, 2019). We've made some great progress on testing recently. However, the `TabTests` are still incapable of creating types that user their own XAML file. Case in point here is `TerminalPage`. It fails when we attempt to `InitializeComponent`, because xaml attempts to load `ms-appx:///TerminalApp/TerminalPage.xaml`. I'm not really sure at the moment why that's not able to be loaded. I do know that we're not using the `resources.pri` file here for this test. I've tried manually generating a `resources.pri` using a lightly modified version of `CascadiaPackage`'s `priconfig.xml` and the following commands: ``` makepri new /mn TerminalApp.LocalTests.AppxManifest.xml /pr . /cf mypriconfig4.xml /verbose /o makepri dump /if resources.pri /of resources.xml /o ``` However, if I do that directly, then the `App.xbf` gets stuck into the `resources.pri` with the files we do need, which causes the test to explode again. I tried manually moving the following files to a `TerminalApp` subdir of , and adding them to `filtered.layout.resfiles`. That got them into `Files/TerminalApp` in the `resources.pri` file, but didn't fix the loading issue. Seemed like they only had their paths added, not the files themselves. ``` TerminalApp\MinMaxCloseControl.xbf TerminalApp\TabRowControl.xbf TerminalApp\TerminalPage.xbf TerminalApp\TitlebarControl.xbf ``` I also tried just _not_ compiling App.xaml/idl/h/cpp as a part of `TerminalAppLib.vcxproj`, and still just including the `...\x64\Debug\TerminalAppLib\TerminalApp.pri` line in `pri.resfiles`. This placed the `TerminalApp` .xbf files in the right place, without the `App.xbf`, but it _still_ failed to parse `TerminalPage.xaml`. I was hoping that I could just move `App.xaml` to it's own project, and get rd of a bunch of this chaos. Unfortunately, this did not work. I don't have any ideas how to fix this at the moment.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5606