From d79bb01433401a144816a386c5411ac4c08b6187 Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Thu, 25 Apr 2024 14:57:14 +0200 Subject: [PATCH] [browser] enable CI testing with Firefox (#100697) --- .../templates/wasm-library-aot-tests.yml | 5 +- .../common/templates/wasm-library-tests.yml | 4 +- .../runtime-extra-platforms-wasm.yml | 3 +- eng/pipelines/runtime.yml | 3 + eng/testing/BrowserVersions.props | 4 +- eng/testing/WasmRunnerTemplate.cmd | 30 ++++++++-- eng/testing/WasmRunnerTemplate.sh | 17 +++++- eng/testing/tests.browser.targets | 9 +++ eng/testing/tests.wasi.targets | 7 +++ eng/testing/wasm-provisioning.targets | 59 +++++++++++-------- .../tests/System/Net/Configuration.Http.cs | 25 ++++++-- .../System/Net/Configuration.WebSockets.cs | 31 +++++++++- .../HttpClientHandlerTest.Authentication.cs | 2 +- .../HttpClientHandlerTest.RemoteServer.cs | 14 +++-- ...ttpClientHandlerTest.ServerCertificates.cs | 2 +- .../System/Net/Http/HttpClientHandlerTest.cs | 11 +++- .../tests/System/Net/Http/PostScenarioTest.cs | 2 +- .../System/Net/Http/ResponseStreamTest.cs | 13 ++-- .../HttpClientHandlerTest.Headers.cs | 5 ++ .../HttpClientHandlerTest.Http1.cs | 1 + .../FunctionalTests/HttpRequestMessageTest.cs | 1 + .../FunctionalTests/SocketsHttpHandlerTest.cs | 1 + .../tests/ClientWebSocketTestBase.cs | 9 +-- .../tests/ConnectTest.cs | 1 + .../tests/WebSocketCreateTest.cs | 2 +- .../DateTimeFormatInfoNativeCalendarName.cs | 8 +-- src/libraries/sendtohelix-browser.targets | 25 ++++---- src/libraries/sendtohelix-wasi.targets | 4 ++ src/libraries/sendtohelix-wasm.targets | 2 + .../runtime/hybrid-globalization/locales.ts | 12 ++-- src/mono/sample/Directory.Build.props | 18 ++++-- .../sample/wasm/DefaultBrowserSample.targets | 2 +- .../Wasm.Console.Node.Sample.csproj | 2 +- .../console-v8/Wasm.Console.V8.Sample.csproj | 2 +- 34 files changed, 232 insertions(+), 104 deletions(-) diff --git a/eng/pipelines/common/templates/wasm-library-aot-tests.yml b/eng/pipelines/common/templates/wasm-library-aot-tests.yml index 43b90a370450d..cbafd9c6b3553 100644 --- a/eng/pipelines/common/templates/wasm-library-aot-tests.yml +++ b/eng/pipelines/common/templates/wasm-library-aot-tests.yml @@ -1,7 +1,7 @@ parameters: alwaysRun: false extraBuildArgs: '' - extraHelixArgs: '' + extraHelixArguments: '' isExtraPlatformsBuild: false isWasmOnlyBuild: false buildAOTOnHelix: true @@ -26,7 +26,7 @@ jobs: isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} extraBuildArgs: /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=${{ parameters.buildAOTOnHelix }} /p:RunAOTCompilation=${{ parameters.runAOT }} ${{ parameters.extraBuildArgs }} - extraHelixArgs: /p:NeedsToBuildWasmAppsOnHelix=true ${{ parameters.extraHelixArgs }} + extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true ${{ parameters.extraHelixArguments }} alwaysRun: ${{ parameters.alwaysRun }} shouldRunSmokeOnly: ${{ parameters.shouldRunSmokeOnly }} shouldContinueOnError: ${{ parameters.shouldContinueOnError }} @@ -35,5 +35,6 @@ jobs: - WasmTestOnV8 - ${{ if eq(platform, 'browser_wasm_win') }}: - WasmTestOnChrome + - WasmTestOnFirefox - ${{ if or(eq(platform, 'wasi_wasm_win'), eq(platform, 'wasi_wasm')) }}: - WasmTestOnWasmtime diff --git a/eng/pipelines/common/templates/wasm-library-tests.yml b/eng/pipelines/common/templates/wasm-library-tests.yml index 4a1a5a79a30bf..f015563fef00e 100644 --- a/eng/pipelines/common/templates/wasm-library-tests.yml +++ b/eng/pipelines/common/templates/wasm-library-tests.yml @@ -1,7 +1,7 @@ parameters: alwaysRun: false extraBuildArgs: '' - extraHelixArgs: '' + extraHelixArguments: '' isExtraPlatformsBuild: false isWasmOnlyBuild: false nameSuffix: '' @@ -97,5 +97,5 @@ jobs: parameters: creator: dotnet-bot testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:BrowserHost=$(_hostedOs) $(_wasmRunSmokeTestsOnlyArg) ${{ parameters.extraHelixArgs }} + extraHelixArguments: /p:BrowserHost=$(_hostedOs) $(_wasmRunSmokeTestsOnlyArg) ${{ parameters.extraHelixArguments }} scenarios: ${{ parameters.scenarios }} diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index 2c947a048e055..d31cad685995d 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -199,6 +199,7 @@ jobs: scenarios: - WasmTestOnV8 - WasmTestOnChrome + - WasmTestOnFirefox - WasmTestOnNodeJS # Hybrid Globalization AOT tests @@ -321,4 +322,4 @@ jobs: isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} scenarios: - - WasmTestOnV8 + - WasmTestOnWasmtime diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 6bb44bd64fc24..32f99429ffd69 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -843,6 +843,7 @@ extends: scenarios: - WasmTestOnV8 - WasmTestOnChrome + - WasmTestOnFirefox - template: /eng/pipelines/common/templates/wasm-library-tests.yml parameters: @@ -861,10 +862,12 @@ extends: #- browser_wasm_win nameSuffix: _Threading extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + extraHelixArguments: /p:WasmEnableThreads=true alwaysRun: ${{ variables.isRollingBuild }} shouldRunSmokeOnly: onLibrariesAndIllinkChanges scenarios: - WasmTestOnChrome + - WasmTestOnFirefox #- WasmTestOnNodeJS - this is not supported yet, https://github.com/dotnet/runtime/issues/85592 # EAT Library tests - only run on linux diff --git a/eng/testing/BrowserVersions.props b/eng/testing/BrowserVersions.props index b1e85302a8ed3..c66b61a6e4404 100644 --- a/eng/testing/BrowserVersions.props +++ b/eng/testing/BrowserVersions.props @@ -8,7 +8,9 @@ 1250580 https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/1250586 12.3.219 - 124.0.2 + 125.0.1 0.34.0 + 125.0.1 + 0.34.0 diff --git a/eng/testing/WasmRunnerTemplate.cmd b/eng/testing/WasmRunnerTemplate.cmd index 0c7f3dc2195d2..e043ce7a34e9f 100644 --- a/eng/testing/WasmRunnerTemplate.cmd +++ b/eng/testing/WasmRunnerTemplate.cmd @@ -30,7 +30,11 @@ if [%XHARNESS_COMMAND%] == [] ( if /I [%SCENARIO%]==[WasmTestOnChrome] ( set XHARNESS_COMMAND=test-browser ) else ( - set XHARNESS_COMMAND=test + if /I [%SCENARIO%]==[WasmTestOnFirefox] ( + set XHARNESS_COMMAND=test-browser + ) else ( + set XHARNESS_COMMAND=test + ) ) ) @@ -56,11 +60,25 @@ if /I [%XHARNESS_COMMAND%] == [test] ( ) ) ) else ( - if [%BROWSER_PATH%] == [] if not [%HELIX_CORRELATION_PAYLOAD%] == [] ( - set "BROWSER_PATH=--browser-path^=%HELIX_CORRELATION_PAYLOAD%\chrome-win\chrome.exe" - ) - if [%JS_ENGINE_ARGS%] == [] ( - set "JS_ENGINE_ARGS=--browser-arg^=--js-flags^=--stack-trace-limit^=1000" + if /I [%SCENARIO%] == [WasmTestOnChrome] ( + if [%BROWSER_PATH%] == [] if not [%HELIX_CORRELATION_PAYLOAD%] == [] ( + set "BROWSER_PATH=--browser-path^=%HELIX_CORRELATION_PAYLOAD%\chrome-win\chrome.exe" + ) + if [%JS_ENGINE_ARGS%] == [] ( + set "JS_ENGINE_ARGS=--browser-arg^=--js-flags^=--stack-trace-limit^=1000" + ) + ) else ( + if /I [%SCENARIO%] == [WasmTestOnFirefox] ( + if [%BROWSER_PATH%] == [] if not [%HELIX_CORRELATION_PAYLOAD%] == [] ( + set "BROWSER_PATH=--browser-path^=%HELIX_CORRELATION_PAYLOAD%\firefox\firefox.exe" + ) + if [%JS_ENGINE%] == [] ( + set "JS_ENGINE=--browser^=Firefox" + ) + if [%JS_ENGINE_ARGS%] == [] ( + set "JS_ENGINE_ARGS=--browser-arg^=-private-window" + ) + ) ) ) diff --git a/eng/testing/WasmRunnerTemplate.sh b/eng/testing/WasmRunnerTemplate.sh index bd7f1faadf355..6cf4dc11d4bea 100644 --- a/eng/testing/WasmRunnerTemplate.sh +++ b/eng/testing/WasmRunnerTemplate.sh @@ -26,7 +26,9 @@ else fi if [[ -z "$XHARNESS_COMMAND" ]]; then - if [[ "$SCENARIO" == "WasmTestOnChrome" || "$SCENARIO" == "wasmtestonchrome" ]]; then + if [[ "$SCENARIO" == "WasmTestOnFirefox" || "$SCENARIO" == "wasmtestonfirefox" ]]; then + XHARNESS_COMMAND="test-browser" + elif [[ "$SCENARIO" == "WasmTestOnChrome" || "$SCENARIO" == "wasmtestonchrome" ]]; then XHARNESS_COMMAND="test-browser" else XHARNESS_COMMAND="test" @@ -59,8 +61,17 @@ if [[ "$XHARNESS_COMMAND" == "test" ]]; then fi fi else - if [[ -z "$JS_ENGINE_ARGS" ]]; then - JS_ENGINE_ARGS="--browser-arg=--js-flags=--stack-trace-limit=1000" + if [[ "$SCENARIO" == "WasmTestOnChrome" || "$SCENARIO" == "wasmtestonchrome" ]]; then + if [[ -z "$JS_ENGINE_ARGS" ]]; then + JS_ENGINE_ARGS="--browser-arg=--js-flags=--stack-trace-limit=1000" + fi + elif [[ "$SCENARIO" == "WasmTestOnFirefox" || "$SCENARIO" == "wasmtestonfirefox" ]]; then + if [[ -z "$JS_ENGINE" ]]; then + JS_ENGINE="--browser=Firefox" + fi + if [[ -z "$JS_ENGINE_ARGS" ]]; then + JS_ENGINE_ARGS="--browser-arg=-private-window" + fi fi fi diff --git a/eng/testing/tests.browser.targets b/eng/testing/tests.browser.targets index ccfc96f5211cd..26a2086c850b5 100644 --- a/eng/testing/tests.browser.targets +++ b/eng/testing/tests.browser.targets @@ -250,9 +250,18 @@ <_NodeNpmModuleStringTrimmed Include="@(_NodeNpmModuleString->Trim(':'))" /> + WasmTestOnV8 @(_NodeNpmModuleStringTrimmed, ',') + + diff --git a/eng/testing/tests.wasi.targets b/eng/testing/tests.wasi.targets index d147fea218fe4..989e934dd8412 100644 --- a/eng/testing/tests.wasi.targets +++ b/eng/testing/tests.wasi.targets @@ -147,6 +147,13 @@ + + WasmTestOnWasmtime + + + diff --git a/eng/testing/wasm-provisioning.targets b/eng/testing/wasm-provisioning.targets index 47076a23770dd..540fcfb035fa2 100644 --- a/eng/testing/wasm-provisioning.targets +++ b/eng/testing/wasm-provisioning.targets @@ -21,18 +21,30 @@ - - https://ftp.mozilla.org/pub/firefox/releases/$(linux_FirefoxRevision)/linux-x86_64/en-US/firefox-$(linux_FirefoxRevision).tar.bz2 - https://github.com/mozilla/geckodriver/releases/download/v$(linux_GeckoDriverRevision)/geckodriver-v$(linux_GeckoDriverRevision)-linux64.tar.gz - firefox - geckodriver + $(ArtifactsBinDir)firefox\ firefox geckodriver $(ArtifactsBinDir)geckodriver\ + + + https://ftp.mozilla.org/pub/firefox/releases/$(linux_FirefoxRevision)/linux-x86_64/en-US/firefox-$(linux_FirefoxRevision).tar.bz2 + https://github.com/mozilla/geckodriver/releases/download/v$(linux_GeckoDriverRevision)/geckodriver-v$(linux_GeckoDriverRevision)-linux64.tar.gz + firefox + geckodriver $([MSBuild]::NormalizePath($(FirefoxDir), '.install-firefox-$(linux_FirefoxRevision).stamp')) $([MSBuild]::NormalizePath($(GeckoDriverDir), '.install-geckodriver-$(linux_GeckoDriverRevision).stamp')) + $([MSBuild]::NormalizePath($(FirefoxDir), $(FirefoxDirName), $(FirefoxBinaryName))) + $([MSBuild]::NormalizePath($(GeckoDriverDir), $(GeckoDriverDirName), $(GeckoDriverBinaryName))) + + + https://ftp.mozilla.org/pub/firefox/releases/$(win_FirefoxRevision)/win64/en-US/Firefox%20Setup%20$(win_FirefoxRevision).exe + https://github.com/mozilla/geckodriver/releases/download/v$(win_GeckoDriverRevision)/geckodriver-v$(win_GeckoDriverRevision)-win64.zip + firefox.exe + geckodriver.exe + $([MSBuild]::NormalizePath($(FirefoxDir), '.install-firefox-$(win_FirefoxRevision).stamp')) + $([MSBuild]::NormalizePath($(GeckoDriverDir), '.install-geckodriver-$(win_GeckoDriverRevision).stamp')) $([MSBuild]::NormalizePath($(FirefoxDir), $(FirefoxDirName), $(FirefoxBinaryName))) $([MSBuild]::NormalizePath($(GeckoDriverDir), $(GeckoDriverDirName), $(GeckoDriverBinaryName))) @@ -183,7 +195,7 @@ export __SCRIPT_DIR=%24( cd -- "%24( dirname -- "%24{BASH_SOURCE[0]}" )" &> + Condition="!Exists($(FirefoxStampFile)) and '$(InstallFirefoxForTests)' == 'true'"> <_StampFile Include="$(_BrowserStampDir).install-firefox*.stamp" /> @@ -197,24 +209,22 @@ export __SCRIPT_DIR=%24( cd -- "%24( dirname -- "%24{BASH_SOURCE[0]}" )" &> - - - - - <_FirefoxBinaryPath>$([MSBuild]::NormalizePath($(FirefoxDir), $(FirefoxBinaryName))) - + + + + - + - + + Condition="!Exists($(GeckoDriverStampFile)) and '$(InstallFirefoxForTests)' == 'true'"> <_StampFile Include="$(_BrowserStampDir).install-geckodriver*.stamp" /> @@ -228,18 +238,15 @@ export __SCRIPT_DIR=%24( cd -- "%24( dirname -- "%24{BASH_SOURCE[0]}" )" &> - - - - - - <_GeckoDriverBinaryPath>$([MSBuild]::NormalizePath($(GeckoDriverDir), $(GeckoDriverBinaryName))) - + + + + - + - + diff --git a/src/libraries/Common/tests/System/Net/Configuration.Http.cs b/src/libraries/Common/tests/System/Net/Configuration.Http.cs index ae1481c56061c..460b7893cc635 100644 --- a/src/libraries/Common/tests/System/Net/Configuration.Http.cs +++ b/src/libraries/Common/tests/System/Net/Configuration.Http.cs @@ -58,12 +58,19 @@ public static partial class Http public static readonly Uri RemoteEchoServer = new Uri("http://" + Host + "/" + EchoHandler); public static readonly Uri SecureRemoteEchoServer = new Uri("https://" + SecureHost + "/" + EchoHandler); public static readonly Uri Http2RemoteEchoServer = new Uri("https://" + Http2Host + "/" + EchoHandler); - public static readonly Uri[] EchoServerList = new Uri[] { RemoteEchoServer, SecureRemoteEchoServer, Http2RemoteEchoServer }; + public static Uri[] GetEchoServerList() + { + if (PlatformDetection.IsFirefox) + { + // https://github.com/dotnet/runtime/issues/101115 + return [RemoteEchoServer]; + } + return [RemoteEchoServer, SecureRemoteEchoServer, Http2RemoteEchoServer]; + } public static readonly Uri RemoteVerifyUploadServer = new Uri("http://" + Host + "/" + VerifyUploadHandler); public static readonly Uri SecureRemoteVerifyUploadServer = new Uri("https://" + SecureHost + "/" + VerifyUploadHandler); public static readonly Uri Http2RemoteVerifyUploadServer = new Uri("https://" + Http2Host + "/" + VerifyUploadHandler); - public static readonly Uri[] VerifyUploadServerList = new Uri[] { RemoteVerifyUploadServer, SecureRemoteVerifyUploadServer, Http2RemoteVerifyUploadServer }; public static readonly Uri RemoteEmptyContentServer = new Uri("http://" + Host + "/" + EmptyContentHandler); public static readonly Uri RemoteDeflateServer = new Uri("http://" + Host + "/" + DeflateHandler); @@ -72,7 +79,7 @@ public static partial class Http public static readonly Uri Http2RemoteGZipServer = new Uri("https://" + Http2Host + "/" + GZipHandler); public static Uri RemoteLoopServer => new Uri("ws://" + RemoteLoopHost + "/" + RemoteLoopHandler); - public static readonly object[][] EchoServers = EchoServerList.Select(x => new object[] { x }).ToArray(); + public static readonly object[][] EchoServers = GetEchoServerList().Select(x => new object[] { x }).ToArray(); public static readonly object[][] VerifyUploadServers = { new object[] { RemoteVerifyUploadServer }, new object[] { SecureRemoteVerifyUploadServer }, new object[] { Http2RemoteVerifyUploadServer } }; public static readonly object[][] CompressedServers = { new object[] { RemoteDeflateServer }, new object[] { RemoteGZipServer }, new object[] { Http2RemoteDeflateServer }, new object[] { Http2RemoteGZipServer } }; @@ -83,9 +90,17 @@ public static partial class Http public static readonly RemoteServer RemoteSecureHttp11Server = new RemoteServer(new Uri("https://" + SecureHost + "/"), HttpVersion.Version11); public static readonly RemoteServer RemoteHttp2Server = new RemoteServer(new Uri("https://" + Http2Host + "/"), new Version(2, 0)); - public static readonly IEnumerable RemoteServers = new RemoteServer[] { RemoteHttp11Server, RemoteSecureHttp11Server, RemoteHttp2Server }; + public static IEnumerable GetRemoteServers() + { + if (PlatformDetection.IsFirefox) + { + // https://github.com/dotnet/runtime/issues/101115 + return new RemoteServer[] { RemoteHttp11Server }; + } + return new RemoteServer[] { RemoteHttp11Server, RemoteSecureHttp11Server, RemoteHttp2Server }; + } - public static readonly IEnumerable RemoteServersMemberData = RemoteServers.Select(s => new object[] { s }); + public static readonly IEnumerable RemoteServersMemberData = GetRemoteServers().Select(s => new object[] { s }); public sealed class RemoteServer { diff --git a/src/libraries/Common/tests/System/Net/Configuration.WebSockets.cs b/src/libraries/Common/tests/System/Net/Configuration.WebSockets.cs index a24512ce3b4a5..c5686be67b4ef 100644 --- a/src/libraries/Common/tests/System/Net/Configuration.WebSockets.cs +++ b/src/libraries/Common/tests/System/Net/Configuration.WebSockets.cs @@ -22,8 +22,35 @@ public static partial class WebSockets public static readonly Uri RemoteEchoHeadersServer = new Uri("ws://" + Host + "/" + EchoHeadersHandler); public static readonly Uri SecureRemoteEchoHeadersServer = new Uri("wss://" + SecureHost + "/" + EchoHeadersHandler); - public static readonly object[][] EchoServers = { new object[] { RemoteEchoServer }, new object[] { SecureRemoteEchoServer } }; - public static readonly object[][] EchoHeadersServers = { new object[] { RemoteEchoHeadersServer }, new object[] { SecureRemoteEchoHeadersServer } }; + public static object[][] GetEchoServers() + { + if (PlatformDetection.IsFirefox) + { + // https://github.com/dotnet/runtime/issues/101115 + return new object[][] { + new object[] { RemoteEchoServer }, + }; + } + return new object[][] { + new object[] { RemoteEchoServer }, + new object[] { SecureRemoteEchoServer }, + }; + } + + public static object[][] GetEchoHeadersServers() + { + if (PlatformDetection.IsFirefox) + { + // https://github.com/dotnet/runtime/issues/101115 + return new object[][] { + new object[] { RemoteEchoHeadersServer }, + }; + } + return new object[][] { + new object[] { RemoteEchoHeadersServer }, + new object[] { SecureRemoteEchoHeadersServer }, + }; + } } } } diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs index b19c02b52ebc0..430cfeb2d4729 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs @@ -546,7 +546,7 @@ public static IEnumerable ServerUsesWindowsAuthentication_MemberData() public static IEnumerable EchoServersData() { - foreach (Uri serverUri in Configuration.Http.EchoServerList) + foreach (Uri serverUri in Configuration.Http.GetEchoServerList()) { yield return new object[] { serverUri }; } diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs index a264482a5549b..dd9db9bbe1f08 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs @@ -47,7 +47,7 @@ private static IEnumerable GetMethods(params string[] methods) { foreach (string method in methods) { - foreach (Uri serverUri in Configuration.Http.EchoServerList) + foreach (Uri serverUri in Configuration.Http.GetEchoServerList()) { yield return new object[] { method, serverUri }; } @@ -164,6 +164,7 @@ public async Task GetAsync_ServerNeedsAuthAndSetCredential_StatusCodeOK(Configur [OuterLoop("Uses external servers", typeof(PlatformDetection), nameof(PlatformDetection.LocalEchoServerIsNotAvailable))] [Theory, MemberData(nameof(RemoteServersMemberData))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task GetAsync_ServerNeedsAuthAndNoCredential_StatusCodeUnauthorized(Configuration.Http.RemoteServer remoteServer) { using (HttpClient client = CreateHttpClientForRemoteServer(remoteServer)) @@ -275,7 +276,7 @@ public static IEnumerable RemoteServersHeaderValuesAndUris() public static IEnumerable<(Configuration.Http.RemoteServer remoteServer, Uri uri)> RemoteServersAndHeaderEchoUris() { - foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.RemoteServers) + foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.GetRemoteServers()) { yield return (remoteServer, remoteServer.EchoUri); yield return (remoteServer, remoteServer.RedirectUriForDestinationUri( @@ -464,7 +465,7 @@ public static IEnumerable VerifyUploadServersStreamsAndExpectedData { get { - foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.RemoteServers) // target server + foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.GetRemoteServers()) // target server foreach (bool syncCopy in BoolValues) // force the content copy to happen via Read/Write or ReadAsync/WriteAsync { byte[] data = new byte[1234]; @@ -868,7 +869,7 @@ public async Task SendAsync_SendRequestUsingNoBodyMethodToEchoServerWithContent_ public static IEnumerable SendAsync_SendSameRequestMultipleTimesDirectlyOnHandler_Success_MemberData() { - foreach (var server in Configuration.Http.RemoteServers) + foreach (var server in Configuration.Http.GetRemoteServers()) { yield return new object[] { server, "12345678910", 0 }; yield return new object[] { server, "12345678910", 5 }; @@ -909,7 +910,7 @@ public async Task SendAsync_SendSameRequestMultipleTimesDirectlyOnHandler_Succes public static IEnumerable RemoteServersAndRedirectStatusCodes() { - foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.RemoteServers) + foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.GetRemoteServers()) { yield return new object[] { remoteServer, 300 }; yield return new object[] { remoteServer, 301 }; @@ -1228,7 +1229,7 @@ public async Task DefaultHeaders_SetCredentials_ClearedOnRedirect(Configuration. public static IEnumerable RemoteServersAndCompressionUris() { - foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.RemoteServers) + foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.GetRemoteServers()) { yield return new object[] { remoteServer, remoteServer.GZipUri }; @@ -1329,6 +1330,7 @@ public async Task GetAsync_SetAutomaticDecompression_HeadersRemoved(Configuratio [OuterLoop("Uses external servers", typeof(PlatformDetection), nameof(PlatformDetection.LocalEchoServerIsNotAvailable))] [Theory] [MemberData(nameof(Http2Servers))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task SendAsync_RequestVersion20_ResponseVersion20IfHttp2Supported(Uri server) { // Sync API supported only up to HTTP/1.1 diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs index eca2101b78edb..236af85b26035 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs @@ -116,7 +116,7 @@ public async Task UseCallback_NotSecureConnection_CallbackNotCalled() public static IEnumerable UseCallback_ValidCertificate_ExpectedValuesDuringCallback_Urls() { - foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.RemoteServers) + foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.GetRemoteServers()) { if (remoteServer.IsSecure) { diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs index 0e6faffa6d162..31d8d9f154fc4 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs @@ -412,6 +412,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri => [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/86317", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task PostAsync_ManyDifferentRequestHeaders_SentCorrectly() { if (IsWinHttpHandler && UseVersion >= HttpVersion20.Value) @@ -826,6 +827,7 @@ await TestHelper.WhenAllCompletedOrAnyFailed( [InlineData("7gibberish")] // valid size then gibberish [InlineData("7\v\f")] // unacceptable whitespace [ActiveIssue("https://github.com/dotnet/runtime/issues/86317", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task GetAsync_InvalidChunkSize_ThrowsHttpRequestException(string chunkSize) { if (UseVersion != HttpVersion.Version11) @@ -859,6 +861,7 @@ await LoopbackServer.CreateServerAsync(async (server, url) => [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/86317", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task GetAsync_InvalidChunkTerminator_ThrowsHttpRequestException() { if (UseVersion != HttpVersion.Version11) @@ -888,6 +891,7 @@ await LoopbackServer.CreateClientAndServerAsync(async url => [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/86317", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task GetAsync_InfiniteChunkSize_ThrowsHttpRequestException() { if (UseVersion != HttpVersion.Version11) @@ -1011,9 +1015,9 @@ public async Task ReadAsStreamAsync_HandlerProducesWellBehavedResponseStream(boo return; } - if (enableWasmStreaming && !PlatformDetection.IsBrowser) + if (enableWasmStreaming && !PlatformDetection.IsChromium) { - // enableWasmStreaming makes only sense on Browser platform + // enableWasmStreaming makes only sense on Chrome return; } @@ -1331,7 +1335,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => server => server.AcceptConnectionSendResponseAndCloseAsync()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsChromium))] [ActiveIssue("https://github.com/dotnet/runtime/issues/65429", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))] public async Task ReadAsStreamAsync_StreamingCancellation() { @@ -1425,6 +1429,7 @@ await server.AcceptConnectionAsync(async connection => } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task Dispose_DisposingHandlerCancelsActiveOperationsWithoutResponses() { if (IsWinHttpHandler && UseVersion >= HttpVersion20.Value) diff --git a/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs b/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs index 488f00639cb0a..6f465ff0e998c 100644 --- a/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs +++ b/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs @@ -135,7 +135,7 @@ public async Task PostUsingNoSpecifiedSemantics_UsesChunkedSemantics(Configurati public static IEnumerable RemoteServersAndLargeContentSizes() { - foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.RemoteServers) + foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.GetRemoteServers()) { yield return new object[] { remoteServer, 5 * 1024 }; yield return new object[] { remoteServer, 63 * 1024 }; diff --git a/src/libraries/Common/tests/System/Net/Http/ResponseStreamTest.cs b/src/libraries/Common/tests/System/Net/Http/ResponseStreamTest.cs index e38204ffc031e..aaa4b9c9b1c3a 100644 --- a/src/libraries/Common/tests/System/Net/Http/ResponseStreamTest.cs +++ b/src/libraries/Common/tests/System/Net/Http/ResponseStreamTest.cs @@ -21,7 +21,7 @@ public ResponseStreamTest(ITestOutputHelper output) : base(output) { } public static IEnumerable RemoteServersAndReadModes() { - foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.RemoteServers) + foreach (Configuration.Http.RemoteServer remoteServer in Configuration.Http.GetRemoteServers()) { for (int i = 0; i < 8; i++) { @@ -230,7 +230,7 @@ await client.GetAsync(remoteServer.EchoUri, HttpCompletionOption.ResponseHeaders #if NETCOREAPP - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsChromium))] public async Task BrowserHttpHandler_Streaming() { var WebAssemblyEnableStreamingRequestKey = new HttpRequestOptionsKey("WebAssemblyEnableStreamingRequest"); @@ -287,7 +287,7 @@ public async Task BrowserHttpHandler_Streaming() } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsChromium))] public async Task BrowserHttpHandler_StreamingRequest() { var WebAssemblyEnableStreamingRequestKey = new HttpRequestOptionsKey("WebAssemblyEnableStreamingRequest"); @@ -330,7 +330,7 @@ public async Task BrowserHttpHandler_StreamingRequest() // Duplicate of PostAsync_ThrowFromContentCopy_RequestFails using remote server [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsChromium))] [InlineData(false)] [InlineData(true)] public async Task BrowserHttpHandler_StreamingRequest_ThrowFromContentCopy_RequestFails(bool syncFailure) @@ -368,7 +368,7 @@ public static TheoryData CancelRequestReadFunctions }; [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsChromium))] [MemberData(nameof(CancelRequestReadFunctions))] public async Task BrowserHttpHandler_StreamingRequest_CancelRequest(bool cancelAsync, Func> readFunc) { @@ -438,7 +438,7 @@ public async Task BrowserHttpHandler_StreamingRequest_Http1Fails() } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsChromium))] public async Task BrowserHttpHandler_StreamingResponse() { var WebAssemblyEnableStreamingResponseKey = new HttpRequestOptionsKey("WebAssemblyEnableStreamingResponse"); @@ -477,6 +477,7 @@ public async Task BrowserHttpHandler_StreamingResponse() [InlineData(TransferType.ContentLength, TransferError.ContentLengthTooLarge)] [InlineData(TransferType.Chunked, TransferError.MissingChunkTerminator)] [InlineData(TransferType.Chunked, TransferError.ChunkSizeTooLarge)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task ReadAsStreamAsync_InvalidServerResponse_ThrowsIOException( TransferType transferType, TransferError transferError) diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Headers.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Headers.cs index 4807d9de7842c..cbd74f8188a20 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Headers.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Headers.cs @@ -26,6 +26,7 @@ public HttpClientHandlerTest_Headers(ITestOutputHelper output) : base(output) { private sealed class DerivedHttpHeaders : HttpHeaders { } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task SendAsync_RequestWithSimpleHeader_ResponseReferencesUnmodifiedRequestHeaders() { const string HeaderKey = "some-header-123", HeaderValue = "this is the expected header value"; @@ -73,6 +74,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task SendAsync_LargeHeaders_CorrectlyWritten() { if (UseVersion == HttpVersion.Version30) @@ -108,6 +110,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task SendAsync_DefaultHeaders_CorrectlyWritten() { const string Version = "2017-04-17"; @@ -169,6 +172,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => [InlineData("Accept-CharSet", "text/plain, text/json", false)] // invalid format for header but added with TryAddWithoutValidation [InlineData("Content-Location", "", false)] // invalid format for header but added with TryAddWithoutValidation [InlineData("Max-Forwards", "NotAnInteger", false)] // invalid format for header but added with TryAddWithoutValidation + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task SendAsync_SpecialHeaderKeyOrValue_Success(string key, string value, bool parsable) { if (PlatformDetection.IsBrowser && (key == "Content-Location" || key == "Date" || key == "Accept-CharSet")) @@ -356,6 +360,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => [Theory] [InlineData(false)] [InlineData(true)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task SendAsync_GetWithValidHostHeader_Success(bool withPort) { if (UseVersion == HttpVersion.Version30) diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http1.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http1.cs index b3949e548e7cc..b57e381278459 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http1.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Http1.cs @@ -17,6 +17,7 @@ public class HttpClientHandlerTest_Http1 : HttpClientHandlerTestBase public HttpClientHandlerTest_Http1(ITestOutputHelper output) : base(output) { } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNodeJS))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task SendAsync_HostHeader_First() { // RFC 7230 3.2.2. Field Order diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpRequestMessageTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpRequestMessageTest.cs index 0dd1a485894d6..d62566f1dd1b4 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpRequestMessageTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpRequestMessageTest.cs @@ -239,6 +239,7 @@ public void ToString_DefaultAndNonDefaultInstance_DumpAllFields() [InlineData("OPTIONS")] [InlineData("HEAD")] [ActiveIssue("https://github.com/dotnet/runtime/issues/86317", typeof(PlatformDetection), nameof(PlatformDetection.IsNodeJS))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task HttpRequest_BodylessMethod_NoContentLength(string method) { using (HttpClient client = CreateHttpClient()) diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs index c0eda6ab1a57e..67604ca426e79 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs @@ -3994,6 +3994,7 @@ public SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http11(ITestOutputHe [InlineData("foo", "\tbar\t")] [InlineData("foo", "\t bar \t")] [InlineData("foo ", " \t bar \r\n ")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task ResponseHeaders_ExtraWhitespace_Trimmed(string name, string value) { await LoopbackServer.CreateClientAndServerAsync(async uri => diff --git a/src/libraries/System.Net.WebSockets.Client/tests/ClientWebSocketTestBase.cs b/src/libraries/System.Net.WebSockets.Client/tests/ClientWebSocketTestBase.cs index 0c8b94778a58e..0dc1775b57345 100644 --- a/src/libraries/System.Net.WebSockets.Client/tests/ClientWebSocketTestBase.cs +++ b/src/libraries/System.Net.WebSockets.Client/tests/ClientWebSocketTestBase.cs @@ -15,18 +15,13 @@ namespace System.Net.WebSockets.Client.Tests { public class ClientWebSocketTestBase { - public static readonly object[][] EchoServers = System.Net.Test.Common.Configuration.WebSockets.EchoServers; - public static readonly object[][] EchoHeadersServers = System.Net.Test.Common.Configuration.WebSockets.EchoHeadersServers; + public static readonly object[][] EchoServers = System.Net.Test.Common.Configuration.WebSockets.GetEchoServers(); + public static readonly object[][] EchoHeadersServers = System.Net.Test.Common.Configuration.WebSockets.GetEchoHeadersServers(); public static readonly object[][] EchoServersAndBoolean = EchoServers.SelectMany(o => new object[][] { new object[] { o[0], false }, new object[] { o[0], true } }).ToArray(); - public static readonly object[][] SecureEchoServersAndBoolean = new object[][] - { - new object[] { Test.Common.Configuration.WebSockets.SecureRemoteEchoServer, false }, - new object[] { Test.Common.Configuration.WebSockets.SecureRemoteEchoServer, true } - }; public const int TimeOutMilliseconds = 30000; public const int CloseDescriptionMaxLength = 123; diff --git a/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs b/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs index 7f44a7a69349a..cb5f0f978f761 100644 --- a/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs +++ b/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs @@ -254,6 +254,7 @@ public async Task ConnectAsync_CookieHeaders_Success(Uri server) [OuterLoop("Uses external servers", typeof(PlatformDetection), nameof(PlatformDetection.LocalEchoServerIsNotAvailable))] [ConditionalTheory(nameof(WebSocketsSupported)), MemberData(nameof(EchoServers))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/101115", typeof(PlatformDetection), nameof(PlatformDetection.IsFirefox))] public async Task ConnectAsync_PassNoSubProtocol_ServerRequires_ThrowsWebSocketException(Uri server) { const string AcceptedProtocol = "CustomProtocol"; diff --git a/src/libraries/System.Net.WebSockets/tests/WebSocketCreateTest.cs b/src/libraries/System.Net.WebSockets/tests/WebSocketCreateTest.cs index f8323a2033202..988f8e4eaaa92 100644 --- a/src/libraries/System.Net.WebSockets/tests/WebSocketCreateTest.cs +++ b/src/libraries/System.Net.WebSockets/tests/WebSocketCreateTest.cs @@ -344,7 +344,7 @@ private static async Task CreateWebSocketStream(Uri echoUri, Socket clie return stream; } - public static readonly object[][] EchoServers = System.Net.Test.Common.Configuration.WebSockets.EchoServers; + public static readonly object[][] EchoServers = System.Net.Test.Common.Configuration.WebSockets.GetEchoServers(); public static readonly object[][] EchoServersAndBoolean = EchoServers.SelectMany(o => new object[][] { new object[] { o[0], false }, diff --git a/src/libraries/System.Runtime/tests/System.Globalization.Tests/DateTimeFormatInfo/DateTimeFormatInfoNativeCalendarName.cs b/src/libraries/System.Runtime/tests/System.Globalization.Tests/DateTimeFormatInfo/DateTimeFormatInfoNativeCalendarName.cs index 86507dc1308f1..377e6d30d597b 100644 --- a/src/libraries/System.Runtime/tests/System.Globalization.Tests/DateTimeFormatInfo/DateTimeFormatInfoNativeCalendarName.cs +++ b/src/libraries/System.Runtime/tests/System.Globalization.Tests/DateTimeFormatInfo/DateTimeFormatInfoNativeCalendarName.cs @@ -11,10 +11,10 @@ public class DateTimeFormatInfoNativeCalendarName public static IEnumerable NativeCalendarName_Get_TestData_HybridGlobalization() { // see the comments on the right to check the non-Hybrid result, in this collection it always differs - string islamicName = "islamic-umalqura"; - string gregorianName = "gregory"; - string persianName = "persian"; - string bhuddistName = "buddhist"; + string islamicName = PlatformDetection.IsFirefox ? "UMALQURA" : "islamic-umalqura"; + string gregorianName = PlatformDetection.IsFirefox ? "GREGORIAN" : "gregory"; + string persianName = PlatformDetection.IsFirefox ? "PERSIAN" : "persian"; + string bhuddistName = PlatformDetection.IsFirefox ? "THAI" : "buddhist"; yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, islamicName }; // التقويم الإسلامي (أم القرى) yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, gregorianName }; // የግሪጎሪያን የቀን አቆጣጠር yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, gregorianName }; // григориански календар diff --git a/src/libraries/sendtohelix-browser.targets b/src/libraries/sendtohelix-browser.targets index 8b9a419456577..393b4dd38f1ff 100644 --- a/src/libraries/sendtohelix-browser.targets +++ b/src/libraries/sendtohelix-browser.targets @@ -32,7 +32,8 @@ <_ShippingPackagesPath>$([MSBuild]::NormalizeDirectory($(ArtifactsDir), 'packages', $(Configuration), 'Shipping')) - $(Scenario)- + $(Scenario)-ST- + $(Scenario)-MT- true - - - - @@ -112,10 +109,6 @@ - - - - @@ -182,7 +175,13 @@ - + <_WasmSampleZipFile Condition="'$(Scenario)' == 'WasmTestOnV8'" Include="$(TestArchiveRoot)runonly/**/*.Console.V8.*.Sample.zip" /> - <_WasmSampleZipFile Condition="'$(Scenario)' == 'WasmTestOnNodeJS'" Include="$(TestArchiveRoot)runonly/**/*.Console.Node.*.Sample.zip" /> + <_WasmSampleZipFile Condition="'$(Scenario)' == 'WasmTestOnNodeJS'" Include="$(TestArchiveRoot)runonly/**/*.Console.Node.*.Sample.zip" /> <_WasmSampleZipFile Condition="'$(Scenario)' == 'WasmTestOnChrome'" Include="$(TestArchiveRoot)runonly/**/*.Browser.*.Sample.zip" /> + - + %(Identity) $(HelixCommand) $(_workItemTimeout) diff --git a/src/libraries/sendtohelix-wasi.targets b/src/libraries/sendtohelix-wasi.targets index f89da35e17e3e..e634fa0c2ea3f 100644 --- a/src/libraries/sendtohelix-wasi.targets +++ b/src/libraries/sendtohelix-wasi.targets @@ -104,6 +104,10 @@ + + diff --git a/src/libraries/sendtohelix-wasm.targets b/src/libraries/sendtohelix-wasm.targets index d9c2e3aead084..10dc71976f62b 100644 --- a/src/libraries/sendtohelix-wasm.targets +++ b/src/libraries/sendtohelix-wasm.targets @@ -31,6 +31,8 @@ Workloads- NoWorkload- $(WorkItemPrefix)NoWebcil- + $(WorkItemPrefix)ST- + $(WorkItemPrefix)MT- diff --git a/src/mono/browser/runtime/hybrid-globalization/locales.ts b/src/mono/browser/runtime/hybrid-globalization/locales.ts index da6a478d1e393..0f04519efdfd3 100644 --- a/src/mono/browser/runtime/hybrid-globalization/locales.ts +++ b/src/mono/browser/runtime/hybrid-globalization/locales.ts @@ -37,12 +37,12 @@ export function mono_wasm_get_locale_info (culture: number, cultureLength: numbe const language = localeParts.join("-"); languageName = new Intl.DisplayNames([cultureName], { type: "language" }).of(language); } catch (error) { - if (error instanceof RangeError && error.message === "invalid_argument") { + if (error instanceof RangeError) { // if it failed from this reason then cultureName is in a form "language-script", without region try { languageName = new Intl.DisplayNames([cultureName], { type: "language" }).of(localeName); } catch (error) { - if (error instanceof RangeError && error.message === "invalid_argument" && localeNameOriginal) { + if (error instanceof RangeError && localeNameOriginal) { // handle non-standard or malformed locales by forwarding the locale code, e.g. "xx-u-xx" stringToUTF16(dst, dst + 2 * localeNameOriginal.length, localeNameOriginal); setI32(dstLength, localeNameOriginal.length); @@ -113,8 +113,8 @@ function getFirstDayOfWeek (locale: string) { if (saturdayLocales.includes(locale)) { return 6; } - const sundayLanguages = ["zh", "th", "pt", "mr", "ml", "ko", "kn", "ja", "id", "hi", "he", "gu", "fil", "bn", "am", "ar"]; - const sundayLocales = ["ta-SG", "ta-IN", "sw-KE", "ms-SG", "fr-CA", "es-MX", "en-US", "en-ZW", "en-ZA", "en-WS", "en-VI", "en-UM", "en-TT", "en-SG", "en-PR", "en-PK", "en-PH", "en-MT", "en-MO", "en-MH", "en-KE", "en-JM", "en-IN", "en-IL", "en-HK", "en-GU", "en-DM", "en-CA", "en-BZ", "en-BW", "en-BS", "en-AU", "en-AS", "en-AG"]; + const sundayLanguages = ["th", "pt", "mr", "ml", "ko", "kn", "ja", "id", "hi", "he", "gu", "fil", "bn", "am", "ar", "te"]; + const sundayLocales = ["ta-SG", "ta-IN", "sw-KE", "ms-SG", "fr-CA", "es-MX", "en-US", "en-ZW", "en-ZA", "en-WS", "en-VI", "en-UM", "en-TT", "en-SG", "en-PR", "en-PK", "en-PH", "en-MT", "en-MO", "en-MH", "en-KE", "en-JM", "en-IN", "en-IL", "en-HK", "en-GU", "en-DM", "en-CA", "en-BZ", "en-BW", "en-BS", "en-AS", "en-AG", "zh-Hans-HK", "zh-SG", "zh-HK", "zh-TW"]; // "en-AU" is Monday in chrome, so firefox should be in line const localeLang = locale.split("-")[0]; if (sundayLanguages.includes(localeLang) || sundayLocales.includes(locale)) { return 0; @@ -134,8 +134,8 @@ function getFirstWeekOfYear (locale: string) { } // Firefox does not support it rn but we can make a temporary workaround for it, // that should be removed when it starts being supported: - const firstFourDayWeekLocales = ["pt-PT", "fr-CH", "fr-FR", "fr-BE", "es-ES", "en-SE", "en-NL", "en-JE", "en-IM", "en-IE", "en-GI", "en-GG", "en-GB", "en-FJ", "en-FI", "en-DK", "en-DE", "en-CH", "en-BE", "en-AT", "el-GR"]; - const firstFourDayWeekLanguages = ["sv", "sk", "ru", "pl", "nl", "no", "lt", "it", "hu", "fi", "et", "de", "da", "cs", "ca", "bg"]; + const firstFourDayWeekLocales = ["pt-PT", "fr-CH", "fr-FR", "fr-BE", "es-ES", "en-SE", "en-NL", "en-JE", "en-IM", "en-IE", "en-GI", "en-GG", "en-GB", "en-FJ", "en-FI", "en-DK", "en-DE", "en-CH", "en-BE", "en-AT", "el-GR", "nl-BE", "nl-NL"]; + const firstFourDayWeekLanguages = ["sv", "sk", "ru", "pl", "no", "nb", "lt", "it", "hu", "fi", "et", "de", "da", "cs", "ca", "bg"]; const localeLang = locale.split("-")[0]; if (firstFourDayWeekLocales.includes(locale) || firstFourDayWeekLanguages.includes(localeLang)) { return 2; diff --git a/src/mono/sample/Directory.Build.props b/src/mono/sample/Directory.Build.props index 8780899630286..2d5011ce41f88 100644 --- a/src/mono/sample/Directory.Build.props +++ b/src/mono/sample/Directory.Build.props @@ -5,14 +5,22 @@ true + - $HARNESS_RUNNER - $XHARNESS_OUT + $HARNESS_RUNNER + $XHARNESS_OUT + $XHARNESS_COMMAND + $XHARNESS_ARGS - - %HARNESS_RUNNER% - %XHARNESS_OUT% + %HARNESS_RUNNER% + %XHARNESS_OUT% + %XHARNESS_COMMAND% + %XHARNESS_ARGS% diff --git a/src/mono/sample/wasm/DefaultBrowserSample.targets b/src/mono/sample/wasm/DefaultBrowserSample.targets index d34e280cf19c6..af224ce9c48af 100644 --- a/src/mono/sample/wasm/DefaultBrowserSample.targets +++ b/src/mono/sample/wasm/DefaultBrowserSample.targets @@ -7,7 +7,7 @@ -1 true $(WasmXHarnessArgs) --web-server-use-cop - $(ExecXHarnessCmd) wasm test-browser --app=. --browser=Chrome $(XHarnessBrowserPathArg) $(WasmXHarnessArgs) --html-file=index.html --output-directory=$(XHarnessOutput) -- $(MSBuildProjectName).dll + $(ExecXHarnessVar) wasm $(XHarnessCommandVar) --app=. $(XHarnessBrowserPathArg) $(WasmXHarnessArgsVar) $(WasmXHarnessArgs) --html-file=index.html --output-directory=$(XHarnessOutputVar) -- $(MSBuildProjectName).dll true $(TestArchiveRoot)chromeonly/ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ diff --git a/src/mono/sample/wasm/console-node/Wasm.Console.Node.Sample.csproj b/src/mono/sample/wasm/console-node/Wasm.Console.Node.Sample.csproj index 7234698ff2283..995e1d3650e2c 100644 --- a/src/mono/sample/wasm/console-node/Wasm.Console.Node.Sample.csproj +++ b/src/mono/sample/wasm/console-node/Wasm.Console.Node.Sample.csproj @@ -6,7 +6,7 @@ true 2 - $(ExecXHarnessCmd) wasm test --app=. --engine=NodeJS --engine-arg=--stack-trace-limit=1000 --js-file=main.mjs --output-directory=$(XHarnessOutput) --expected-exit-code $(ExpectedExitCode) + $(ExecXHarnessVar) wasm test --app=. --engine=NodeJS --engine-arg=--stack-trace-limit=1000 --js-file=main.mjs --output-directory=$(XHarnessOutputVar) --expected-exit-code $(ExpectedExitCode) diff --git a/src/mono/sample/wasm/console-v8/Wasm.Console.V8.Sample.csproj b/src/mono/sample/wasm/console-v8/Wasm.Console.V8.Sample.csproj index 13ed38bfe63e4..09e9f7bf1a0d2 100644 --- a/src/mono/sample/wasm/console-v8/Wasm.Console.V8.Sample.csproj +++ b/src/mono/sample/wasm/console-v8/Wasm.Console.V8.Sample.csproj @@ -5,7 +5,7 @@ true true - $(ExecXHarnessCmd) wasm test --app=. --engine=V8 --engine-arg=--stack-trace-limit=1000 --engine-arg=--module --js-file=main.mjs --output-directory=$(XHarnessOutput) -- --run $(MSBuildProjectName).dll + $(ExecXHarnessVar) wasm test --app=. --engine=V8 --engine-arg=--stack-trace-limit=1000 --engine-arg=--module --js-file=main.mjs --output-directory=$(XHarnessOutputVar) -- --run $(MSBuildProjectName).dll