diff --git a/.ado/jobs/universal.yml b/.ado/jobs/universal.yml index 12ee3ca5ed3..a31c4f9f393 100644 --- a/.ado/jobs/universal.yml +++ b/.ado/jobs/universal.yml @@ -30,12 +30,20 @@ BuildConfiguration: Debug BuildPlatform: x64 UseFabric: true + - Name: X86ReleaseFabric # Specifically built so binskim / tests get run on fabric + BuildConfiguration: Release + BuildPlatform: x86 + UseFabric: true - BuildEnvironment: SecurePullRequest Matrix: - Name: X64DebugFabric BuildConfiguration: Debug BuildPlatform: x64 UseFabric: true + - Name: X86ReleaseFabric # Specifically built so binskim / tests get run on fabric + BuildConfiguration: Release + BuildPlatform: x86 + UseFabric: true - BuildEnvironment: Continuous Matrix: - Name: X64Debug diff --git a/change/react-native-windows-4d8d825f-a8b0-4648-8616-b8e262062143.json b/change/react-native-windows-4d8d825f-a8b0-4648-8616-b8e262062143.json new file mode 100644 index 00000000000..0a9b6d731a4 --- /dev/null +++ b/change/react-native-windows-4d8d825f-a8b0-4648-8616-b8e262062143.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Fix Microsoft.ReactNative.IntegrationTests to run with Fabric", + "packageName": "react-native-windows", + "email": "jthysell@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Microsoft.ReactNative.IntegrationTests/Microsoft.ReactNative.IntegrationTests.vcxproj b/vnext/Microsoft.ReactNative.IntegrationTests/Microsoft.ReactNative.IntegrationTests.vcxproj index e4fe0ec40b2..f57b6d0f9f4 100644 --- a/vnext/Microsoft.ReactNative.IntegrationTests/Microsoft.ReactNative.IntegrationTests.vcxproj +++ b/vnext/Microsoft.ReactNative.IntegrationTests/Microsoft.ReactNative.IntegrationTests.vcxproj @@ -10,6 +10,15 @@ + + + false + Windows Store + 10.0 + 10.0.22000.0 + true + None + Debug @@ -54,6 +63,9 @@ --> + + + @@ -167,6 +179,9 @@ + + + diff --git a/vnext/Microsoft.ReactNative.IntegrationTests/ReactInstanceSettingsTests.cpp b/vnext/Microsoft.ReactNative.IntegrationTests/ReactInstanceSettingsTests.cpp index 9a0f48cbba8..1ad2055ab55 100644 --- a/vnext/Microsoft.ReactNative.IntegrationTests/ReactInstanceSettingsTests.cpp +++ b/vnext/Microsoft.ReactNative.IntegrationTests/ReactInstanceSettingsTests.cpp @@ -4,11 +4,21 @@ #include "pch.h" #include + +#ifdef USE_WINUI3 +#include +#else #include +#endif using namespace winrt; using namespace Microsoft::ReactNative; + +#ifdef USE_WINUI3 +using namespace Microsoft::UI::Dispatching; +#else using namespace Windows::System; +#endif namespace ReactNativeIntegrationTests { diff --git a/vnext/Microsoft.ReactNative.IntegrationTests/TestReactNativeHostHolder.cpp b/vnext/Microsoft.ReactNative.IntegrationTests/TestReactNativeHostHolder.cpp index 5c78991b2f8..17eb4bf6e3f 100644 --- a/vnext/Microsoft.ReactNative.IntegrationTests/TestReactNativeHostHolder.cpp +++ b/vnext/Microsoft.ReactNative.IntegrationTests/TestReactNativeHostHolder.cpp @@ -9,7 +9,6 @@ namespace ReactNativeIntegrationTests { using namespace winrt; -using namespace Windows::System; // Work around crash in DeviceInfo when running outside of XAML environment REACT_MODULE(DeviceInfo) @@ -51,7 +50,11 @@ TestReactNativeHostHolder::TestReactNativeHostHolder( Mso::Functor &&hostInitializer, Options &&options) noexcept { m_host = winrt::Microsoft::ReactNative::ReactNativeHost{}; - m_queueController = DispatcherQueueController::CreateOnDedicatedThread(); +#ifdef USE_WINUI3 + m_queueController = winrt::Microsoft::UI::Dispatching::DispatcherQueueController::CreateOnDedicatedThread(); +#else + m_queueController = winrt::Windows::System::DispatcherQueueController::CreateOnDedicatedThread(); +#endif m_queueController.DispatcherQueue().TryEnqueue([this, jsBundle = std::wstring{jsBundle}, hostInitializer = std::move(hostInitializer), diff --git a/vnext/Microsoft.ReactNative.IntegrationTests/TestReactNativeHostHolder.h b/vnext/Microsoft.ReactNative.IntegrationTests/TestReactNativeHostHolder.h index 43be4ecec3f..4a11647cb4b 100644 --- a/vnext/Microsoft.ReactNative.IntegrationTests/TestReactNativeHostHolder.h +++ b/vnext/Microsoft.ReactNative.IntegrationTests/TestReactNativeHostHolder.h @@ -5,9 +5,14 @@ #include #include -#include #include +#ifdef USE_WINUI3 +#include +#else +#include +#endif + namespace ReactNativeIntegrationTests { struct TestReactNativeHostHolder { @@ -25,7 +30,11 @@ struct TestReactNativeHostHolder { private: winrt::Microsoft::ReactNative::ReactNativeHost m_host{nullptr}; +#ifdef USE_WINUI3 + winrt::Microsoft::UI::Dispatching::DispatcherQueueController m_queueController{nullptr}; +#else winrt::Windows::System::DispatcherQueueController m_queueController{nullptr}; +#endif }; } // namespace ReactNativeIntegrationTests diff --git a/vnext/Mso.UnitTests/Mso.UnitTests.vcxproj b/vnext/Mso.UnitTests/Mso.UnitTests.vcxproj index 65e4c389605..b565e08ffba 100644 --- a/vnext/Mso.UnitTests/Mso.UnitTests.vcxproj +++ b/vnext/Mso.UnitTests/Mso.UnitTests.vcxproj @@ -12,6 +12,15 @@ + + + false + Windows Store + 10.0 + 10.0.22000.0 + true + None + Debug @@ -53,6 +62,9 @@ + + + @@ -62,6 +74,7 @@ $(IntDir)pch.pch _CONSOLE;MS_TARGET_WINDOWS;MSO_MOTIFCPP;%(PreprocessorDefinitions) Level4 + $(MSBuildThisFileDirectory);%(AdditionalIncludeDirectories) /await %(AdditionalOptions) /bigobj true Cdecl @@ -147,5 +160,8 @@ + + + \ No newline at end of file