diff --git a/src/cascadia/UnitTests_SettingsModel/MediaResourceTests.cpp b/src/cascadia/UnitTests_SettingsModel/MediaResourceTests.cpp index 294dbfd702..589f0b73e4 100644 --- a/src/cascadia/UnitTests_SettingsModel/MediaResourceTests.cpp +++ b/src/cascadia/UnitTests_SettingsModel/MediaResourceTests.cpp @@ -105,9 +105,10 @@ namespace SettingsModelUnitTests TEST_METHOD(RealResolverUrlCases); TEST_METHOD(RealResolverUNCCases); - static constexpr std::wstring_view pingCommandline{ LR"(C:\Windows\System32\PING.EXE)" }; // Normalized by Profile (this is the casing that Windows stores on disk) - static constexpr std::wstring_view overrideCommandline{ LR"(C:\Windows\System32\cscript.exe)" }; - static constexpr std::wstring_view cmdCommandline{ LR"(C:\Windows\System32\cmd.exe)" }; // The default commandline for a profile + // These are normalized by NormalizeCommandLine, which resolves to the on-disk casing. + // They are used in test cases where media paths fall back to profile command lines. + static inline std::wstring overrideCommandline; + static inline std::wstring cmdCommandline; static constexpr std::wstring_view fragmentBasePath1{ LR"(C:\Windows\Media)" }; private: @@ -218,6 +219,9 @@ namespace SettingsModelUnitTests // Some of our tests use paths under system32. Just don't redirect them. Wow64DisableWow64FsRedirection(&redirectionFlag); #endif + // Normalize these AFTER the call above so that we get the correctly redirected paths. + overrideCommandline = implementation::Profile::NormalizeCommandLine(LR"(C:\Windows\System32\cscript.exe)"); + cmdCommandline = implementation::Profile::NormalizeCommandLine(LR"(C:\Windows\System32\cmd.exe)"); return true; }