Skip to content

Commit d79bb01

Browse files
authored
[browser] enable CI testing with Firefox (#100697)
1 parent 127844c commit d79bb01

34 files changed

+232
-104
lines changed

eng/pipelines/common/templates/wasm-library-aot-tests.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
parameters:
22
alwaysRun: false
33
extraBuildArgs: ''
4-
extraHelixArgs: ''
4+
extraHelixArguments: ''
55
isExtraPlatformsBuild: false
66
isWasmOnlyBuild: false
77
buildAOTOnHelix: true
@@ -26,7 +26,7 @@ jobs:
2626
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
2727
isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
2828
extraBuildArgs: /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=${{ parameters.buildAOTOnHelix }} /p:RunAOTCompilation=${{ parameters.runAOT }} ${{ parameters.extraBuildArgs }}
29-
extraHelixArgs: /p:NeedsToBuildWasmAppsOnHelix=true ${{ parameters.extraHelixArgs }}
29+
extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true ${{ parameters.extraHelixArguments }}
3030
alwaysRun: ${{ parameters.alwaysRun }}
3131
shouldRunSmokeOnly: ${{ parameters.shouldRunSmokeOnly }}
3232
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
@@ -35,5 +35,6 @@ jobs:
3535
- WasmTestOnV8
3636
- ${{ if eq(platform, 'browser_wasm_win') }}:
3737
- WasmTestOnChrome
38+
- WasmTestOnFirefox
3839
- ${{ if or(eq(platform, 'wasi_wasm_win'), eq(platform, 'wasi_wasm')) }}:
3940
- WasmTestOnWasmtime

eng/pipelines/common/templates/wasm-library-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
parameters:
22
alwaysRun: false
33
extraBuildArgs: ''
4-
extraHelixArgs: ''
4+
extraHelixArguments: ''
55
isExtraPlatformsBuild: false
66
isWasmOnlyBuild: false
77
nameSuffix: ''
@@ -97,5 +97,5 @@ jobs:
9797
parameters:
9898
creator: dotnet-bot
9999
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
100-
extraHelixArguments: /p:BrowserHost=$(_hostedOs) $(_wasmRunSmokeTestsOnlyArg) ${{ parameters.extraHelixArgs }}
100+
extraHelixArguments: /p:BrowserHost=$(_hostedOs) $(_wasmRunSmokeTestsOnlyArg) ${{ parameters.extraHelixArguments }}
101101
scenarios: ${{ parameters.scenarios }}

eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ jobs:
199199
scenarios:
200200
- WasmTestOnV8
201201
- WasmTestOnChrome
202+
- WasmTestOnFirefox
202203
- WasmTestOnNodeJS
203204

204205
# Hybrid Globalization AOT tests
@@ -321,4 +322,4 @@ jobs:
321322
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
322323
isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
323324
scenarios:
324-
- WasmTestOnV8
325+
- WasmTestOnWasmtime

eng/pipelines/runtime.yml

+3
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ extends:
843843
scenarios:
844844
- WasmTestOnV8
845845
- WasmTestOnChrome
846+
- WasmTestOnFirefox
846847

847848
- template: /eng/pipelines/common/templates/wasm-library-tests.yml
848849
parameters:
@@ -861,10 +862,12 @@ extends:
861862
#- browser_wasm_win
862863
nameSuffix: _Threading
863864
extraBuildArgs: /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
865+
extraHelixArguments: /p:WasmEnableThreads=true
864866
alwaysRun: ${{ variables.isRollingBuild }}
865867
shouldRunSmokeOnly: onLibrariesAndIllinkChanges
866868
scenarios:
867869
- WasmTestOnChrome
870+
- WasmTestOnFirefox
868871
#- WasmTestOnNodeJS - this is not supported yet, https://github.com/dotnet/runtime/issues/85592
869872

870873
# EAT Library tests - only run on linux

eng/testing/BrowserVersions.props

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
<win_ChromeRevision>1250580</win_ChromeRevision>
99
<win_ChromeBaseSnapshotUrl>https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/1250586</win_ChromeBaseSnapshotUrl>
1010
<win_V8Version>12.3.219</win_V8Version>
11-
<linux_FirefoxRevision>124.0.2</linux_FirefoxRevision>
11+
<linux_FirefoxRevision>125.0.1</linux_FirefoxRevision>
1212
<linux_GeckoDriverRevision>0.34.0</linux_GeckoDriverRevision>
13+
<win_FirefoxRevision>125.0.1</win_FirefoxRevision>
14+
<win_GeckoDriverRevision>0.34.0</win_GeckoDriverRevision>
1315
</PropertyGroup>
1416
</Project>

eng/testing/WasmRunnerTemplate.cmd

+24-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ if [%XHARNESS_COMMAND%] == [] (
3030
if /I [%SCENARIO%]==[WasmTestOnChrome] (
3131
set XHARNESS_COMMAND=test-browser
3232
) else (
33-
set XHARNESS_COMMAND=test
33+
if /I [%SCENARIO%]==[WasmTestOnFirefox] (
34+
set XHARNESS_COMMAND=test-browser
35+
) else (
36+
set XHARNESS_COMMAND=test
37+
)
3438
)
3539
)
3640

@@ -56,11 +60,25 @@ if /I [%XHARNESS_COMMAND%] == [test] (
5660
)
5761
)
5862
) else (
59-
if [%BROWSER_PATH%] == [] if not [%HELIX_CORRELATION_PAYLOAD%] == [] (
60-
set "BROWSER_PATH=--browser-path^=%HELIX_CORRELATION_PAYLOAD%\chrome-win\chrome.exe"
61-
)
62-
if [%JS_ENGINE_ARGS%] == [] (
63-
set "JS_ENGINE_ARGS=--browser-arg^=--js-flags^=--stack-trace-limit^=1000"
63+
if /I [%SCENARIO%] == [WasmTestOnChrome] (
64+
if [%BROWSER_PATH%] == [] if not [%HELIX_CORRELATION_PAYLOAD%] == [] (
65+
set "BROWSER_PATH=--browser-path^=%HELIX_CORRELATION_PAYLOAD%\chrome-win\chrome.exe"
66+
)
67+
if [%JS_ENGINE_ARGS%] == [] (
68+
set "JS_ENGINE_ARGS=--browser-arg^=--js-flags^=--stack-trace-limit^=1000"
69+
)
70+
) else (
71+
if /I [%SCENARIO%] == [WasmTestOnFirefox] (
72+
if [%BROWSER_PATH%] == [] if not [%HELIX_CORRELATION_PAYLOAD%] == [] (
73+
set "BROWSER_PATH=--browser-path^=%HELIX_CORRELATION_PAYLOAD%\firefox\firefox.exe"
74+
)
75+
if [%JS_ENGINE%] == [] (
76+
set "JS_ENGINE=--browser^=Firefox"
77+
)
78+
if [%JS_ENGINE_ARGS%] == [] (
79+
set "JS_ENGINE_ARGS=--browser-arg^=-private-window"
80+
)
81+
)
6482
)
6583
)
6684

eng/testing/WasmRunnerTemplate.sh

+14-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ else
2626
fi
2727

2828
if [[ -z "$XHARNESS_COMMAND" ]]; then
29-
if [[ "$SCENARIO" == "WasmTestOnChrome" || "$SCENARIO" == "wasmtestonchrome" ]]; then
29+
if [[ "$SCENARIO" == "WasmTestOnFirefox" || "$SCENARIO" == "wasmtestonfirefox" ]]; then
30+
XHARNESS_COMMAND="test-browser"
31+
elif [[ "$SCENARIO" == "WasmTestOnChrome" || "$SCENARIO" == "wasmtestonchrome" ]]; then
3032
XHARNESS_COMMAND="test-browser"
3133
else
3234
XHARNESS_COMMAND="test"
@@ -59,8 +61,17 @@ if [[ "$XHARNESS_COMMAND" == "test" ]]; then
5961
fi
6062
fi
6163
else
62-
if [[ -z "$JS_ENGINE_ARGS" ]]; then
63-
JS_ENGINE_ARGS="--browser-arg=--js-flags=--stack-trace-limit=1000"
64+
if [[ "$SCENARIO" == "WasmTestOnChrome" || "$SCENARIO" == "wasmtestonchrome" ]]; then
65+
if [[ -z "$JS_ENGINE_ARGS" ]]; then
66+
JS_ENGINE_ARGS="--browser-arg=--js-flags=--stack-trace-limit=1000"
67+
fi
68+
elif [[ "$SCENARIO" == "WasmTestOnFirefox" || "$SCENARIO" == "wasmtestonfirefox" ]]; then
69+
if [[ -z "$JS_ENGINE" ]]; then
70+
JS_ENGINE="--browser=Firefox"
71+
fi
72+
if [[ -z "$JS_ENGINE_ARGS" ]]; then
73+
JS_ENGINE_ARGS="--browser-arg=-private-window"
74+
fi
6475
fi
6576
fi
6677

eng/testing/tests.browser.targets

+9
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,18 @@
250250
<_NodeNpmModuleStringTrimmed Include="@(_NodeNpmModuleString->Trim(':'))" />
251251
</ItemGroup>
252252
<PropertyGroup>
253+
<Scenario Condition="'$(Scenario)' == ''">WasmTestOnV8</Scenario>
253254
<NodeNpmModuleString>@(_NodeNpmModuleStringTrimmed, ',')</NodeNpmModuleString>
254255
</PropertyGroup>
255256

257+
<Error Condition="'$(Scenario)' != 'WasmTestOnV8' and
258+
'$(Scenario)' != 'WasmTestOnChrome' and
259+
'$(Scenario)' != 'WasmTestOnFirefox' and
260+
'$(Scenario)' != 'WasmTestOnNodeJS' and
261+
'$(Scenario)' != 'WasmDebuggerTests' and
262+
'$(Scenario)' != 'BuildWasmApps'"
263+
Text="Only supported scenarios are WasmTestOnV8, WasmTestOnNodeJS, WasmTestOnChrome, WasmTestOnFirefox, WasmDebuggerTests and BuildWasmApps at the moment. It was $(Scenario)." />
264+
256265
<!-- Restore NPM packages -->
257266
<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
258267
<SetScriptCommands Include="if [[ &quot;$SCENARIO&quot; == &quot;WasmTestOnNodeJS&quot; || &quot;$SCENARIO&quot; == &quot;wasmtestonnodejs&quot; ]]; then export WasmXHarnessMonoArgs=&quot;$WasmXHarnessMonoArgs --setenv=NPM_MODULES=$(NodeNpmModuleString)&quot;; fi" />

eng/testing/tests.wasi.targets

+7
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@
147147
</Target>
148148

149149
<Target Name="_WasiAddToRunScript" BeforeTargets="GenerateRunScript">
150+
<PropertyGroup>
151+
<Scenario Condition="'$(Scenario)' == ''">WasmTestOnWasmtime</Scenario>
152+
</PropertyGroup>
153+
<Error Condition="'$(Scenario)' != 'WasmTestOnWasmtime' and
154+
'$(Scenario)' != 'BuildWasmApps'"
155+
Text="Only supported scenarios are WasmTestOnWasmtime and BuildWasmApps at the moment. It was $(Scenario)." />
156+
150157
<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
151158
<SetScriptCommands Condition="'$(InstallWasmtimeForTests)' == 'true' and Exists($(WasmtimeDir))" Include="export PREPEND_PATH=$(WasmtimeDir)" />
152159
<SetScriptCommands Condition="'$(IsWasiProject)' == 'true'" Include="export RuntimeIdentifier=wasi-wasm" />

eng/testing/wasm-provisioning.targets

+33-26
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,30 @@
2121

2222
<Import Project="$(MSBuildThisFileDirectory)BrowserVersions.props" />
2323

24-
<PropertyGroup Condition="'$(BrowserHost)' != 'windows'">
25-
<FirefoxUrl>https://ftp.mozilla.org/pub/firefox/releases/$(linux_FirefoxRevision)/linux-x86_64/en-US/firefox-$(linux_FirefoxRevision).tar.bz2</FirefoxUrl>
26-
<GeckoDriverUrl>https://github.com/mozilla/geckodriver/releases/download/v$(linux_GeckoDriverRevision)/geckodriver-v$(linux_GeckoDriverRevision)-linux64.tar.gz</GeckoDriverUrl>
27-
<FirefoxBinaryName>firefox</FirefoxBinaryName>
28-
<GeckoDriverBinaryName>geckodriver</GeckoDriverBinaryName>
24+
<PropertyGroup>
2925
<FirefoxDir>$(ArtifactsBinDir)firefox\</FirefoxDir>
3026
<FirefoxDirName>firefox</FirefoxDirName>
3127
<GeckoDriverDirName>geckodriver</GeckoDriverDirName>
3228
<GeckoDriverDir>$(ArtifactsBinDir)geckodriver\</GeckoDriverDir>
29+
</PropertyGroup>
30+
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('linux'))">
31+
<FirefoxUrl>https://ftp.mozilla.org/pub/firefox/releases/$(linux_FirefoxRevision)/linux-x86_64/en-US/firefox-$(linux_FirefoxRevision).tar.bz2</FirefoxUrl>
32+
<GeckoDriverUrl>https://github.com/mozilla/geckodriver/releases/download/v$(linux_GeckoDriverRevision)/geckodriver-v$(linux_GeckoDriverRevision)-linux64.tar.gz</GeckoDriverUrl>
33+
<FirefoxBinaryName>firefox</FirefoxBinaryName>
34+
<GeckoDriverBinaryName>geckodriver</GeckoDriverBinaryName>
3335
<FirefoxStampFile>$([MSBuild]::NormalizePath($(FirefoxDir), '.install-firefox-$(linux_FirefoxRevision).stamp'))</FirefoxStampFile>
3436
<GeckoDriverStampFile>$([MSBuild]::NormalizePath($(GeckoDriverDir), '.install-geckodriver-$(linux_GeckoDriverRevision).stamp'))</GeckoDriverStampFile>
37+
<FirefoxBinaryPath>$([MSBuild]::NormalizePath($(FirefoxDir), $(FirefoxDirName), $(FirefoxBinaryName)))</FirefoxBinaryPath>
38+
<GeckoDriverBinaryPath>$([MSBuild]::NormalizePath($(GeckoDriverDir), $(GeckoDriverDirName), $(GeckoDriverBinaryName)))</GeckoDriverBinaryPath>
39+
</PropertyGroup>
3540

41+
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('windows'))">
42+
<FirefoxUrl>https://ftp.mozilla.org/pub/firefox/releases/$(win_FirefoxRevision)/win64/en-US/Firefox%20Setup%20$(win_FirefoxRevision).exe</FirefoxUrl>
43+
<GeckoDriverUrl>https://github.com/mozilla/geckodriver/releases/download/v$(win_GeckoDriverRevision)/geckodriver-v$(win_GeckoDriverRevision)-win64.zip</GeckoDriverUrl>
44+
<FirefoxBinaryName>firefox.exe</FirefoxBinaryName>
45+
<GeckoDriverBinaryName>geckodriver.exe</GeckoDriverBinaryName>
46+
<FirefoxStampFile>$([MSBuild]::NormalizePath($(FirefoxDir), '.install-firefox-$(win_FirefoxRevision).stamp'))</FirefoxStampFile>
47+
<GeckoDriverStampFile>$([MSBuild]::NormalizePath($(GeckoDriverDir), '.install-geckodriver-$(win_GeckoDriverRevision).stamp'))</GeckoDriverStampFile>
3648
<FirefoxBinaryPath>$([MSBuild]::NormalizePath($(FirefoxDir), $(FirefoxDirName), $(FirefoxBinaryName)))</FirefoxBinaryPath>
3749
<GeckoDriverBinaryPath>$([MSBuild]::NormalizePath($(GeckoDriverDir), $(GeckoDriverDirName), $(GeckoDriverBinaryName)))</GeckoDriverBinaryPath>
3850
</PropertyGroup>
@@ -183,7 +195,7 @@ export __SCRIPT_DIR=%24( cd -- "%24( dirname -- "%24{BASH_SOURCE[0]}" )" &amp;>
183195

184196
<Target Name="DownloadAndInstallFirefox"
185197
AfterTargets="$(WasmProvisionAfterTarget)"
186-
Condition="!Exists($(FirefoxStampFile)) and '$(InstallFirefoxForTests)' == 'true' and !$([MSBuild]::IsOSPlatform('windows'))">
198+
Condition="!Exists($(FirefoxStampFile)) and '$(InstallFirefoxForTests)' == 'true'">
187199
<ItemGroup>
188200
<_StampFile Include="$(_BrowserStampDir).install-firefox*.stamp" />
189201
</ItemGroup>
@@ -197,24 +209,22 @@ export __SCRIPT_DIR=%24( cd -- "%24( dirname -- "%24{BASH_SOURCE[0]}" )" &amp;>
197209
<DownloadFile SourceUrl="$(FirefoxUrl)" DestinationFolder="$(FirefoxDir)" SkipUnchangedFiles="true">
198210
<Output TaskParameter="DownloadedFile" PropertyName="_DownloadedFile" />
199211
</DownloadFile>
200-
<Exec Command="tar -xf $(_DownloadedFile) -C $(FirefoxDir)"/>
201-
<Exec Command="rm -rf $(_DownloadedFile)"/>
202-
203-
<PropertyGroup>
204-
<_FirefoxBinaryPath>$([MSBuild]::NormalizePath($(FirefoxDir), $(FirefoxBinaryName)))</_FirefoxBinaryPath>
205-
</PropertyGroup>
212+
<MakeDir Directories="$(FirefoxDir)\$(FirefoxDirName)"/>
213+
<Exec Command="tar -xf $(_DownloadedFile) -C $(FirefoxDir)" Condition="$([MSBuild]::IsOSPlatform('linux'))" />
214+
<Exec Command="&quot;$(_DownloadedFile)&quot; /InstallDirectoryPath=$(FirefoxDir)$(FirefoxDirName) /TaskbarShortcut=false /DesktopShortcut=false /StartMenuShortcut=false /PrivateBrowsingShortcut=false /MaintenanceService=false /PreventRebootRequired=true" Condition="$([MSBuild]::IsOSPlatform('windows'))" />
215+
<Delete Files="$(_DownloadedFile)" />
206216

207-
<Error Text="Cannot find firefox at $(_FirefoxBinaryPath) in the downloaded copy"
208-
Condition="!Exists($(_FirefoxBinaryPath))" />
217+
<Error Text="Cannot find firefox at $(FirefoxBinaryPath) in the downloaded copy"
218+
Condition="!Exists($(FirefoxBinaryPath))" />
209219

210-
<Exec Command="chmod +x $(_FirefoxBinaryPath)"/>
220+
<Exec Command="chmod +x $(FirefoxBinaryPath)" Condition="$([MSBuild]::IsOSPlatform('linux'))"/>
211221

212222
<Touch Files="$(FirefoxStampFile)" AlwaysCreate="true" />
213223
</Target>
214224

215225
<Target Name="DownloadAndInstallGeckoDriver"
216226
AfterTargets="$(WasmProvisionAfterTarget)"
217-
Condition="!Exists($(GeckoDriverStampFile)) and '$(InstallFirefoxForTests)' == 'true' and !$([MSBuild]::IsOSPlatform('windows'))">
227+
Condition="!Exists($(GeckoDriverStampFile)) and '$(InstallFirefoxForTests)' == 'true'">
218228
<ItemGroup>
219229
<_StampFile Include="$(_BrowserStampDir).install-geckodriver*.stamp" />
220230
</ItemGroup>
@@ -228,18 +238,15 @@ export __SCRIPT_DIR=%24( cd -- "%24( dirname -- "%24{BASH_SOURCE[0]}" )" &amp;>
228238
<DownloadFile SourceUrl="$(GeckoDriverUrl)" DestinationFolder="$(GeckoDriverDir)" SkipUnchangedFiles="true">
229239
<Output TaskParameter="DownloadedFile" PropertyName="_DownloadedFile" />
230240
</DownloadFile>
231-
<Exec Command="mkdir -p $(GeckoDriverDir)/$(GeckoDriverDirName)"/>
232-
<Exec Command="tar -xf $(_DownloadedFile) -C $(GeckoDriverDir)/$(GeckoDriverDirName)"/>
233-
<Exec Command="rm -rf $(_DownloadedFile)"/>
234-
235-
<PropertyGroup>
236-
<_GeckoDriverBinaryPath>$([MSBuild]::NormalizePath($(GeckoDriverDir), $(GeckoDriverBinaryName)))</_GeckoDriverBinaryPath>
237-
</PropertyGroup>
241+
<MakeDir Directories="$(GeckoDriverDir)/$(GeckoDriverDirName)"/>
242+
<Exec Command="tar -xf $(_DownloadedFile) -C $(GeckoDriverDir)/$(GeckoDriverDirName)" Condition="$([MSBuild]::IsOSPlatform('linux'))" />
243+
<Unzip SourceFiles="$(_DownloadedFile)" DestinationFolder="$(GeckoDriverDir)/$(GeckoDriverDirName)" Condition="$([MSBuild]::IsOSPlatform('windows'))" />
244+
<Delete Files="$(_DownloadedFile)" />
238245

239-
<Error Text="Cannot find GeckoDriver at $(_GeckoDriverBinaryPath) in the downloaded copy"
240-
Condition="!Exists($(_GeckoDriverBinaryPath))" />
246+
<Error Text="Cannot find GeckoDriver at $(GeckoDriverBinaryPath) in the downloaded copy"
247+
Condition="!Exists($(GeckoDriverBinaryPath))" />
241248

242-
<Exec Command="chmod +x $(_GeckoDriverBinaryPath)"/>
249+
<Exec Command="chmod +x $(GeckoDriverBinaryPath)" Condition="$([MSBuild]::IsOSPlatform('linux'))" />
243250

244251
<Touch Files="$(GeckoDriverStampFile)" AlwaysCreate="true" />
245252
</Target>

src/libraries/Common/tests/System/Net/Configuration.Http.cs

+20-5
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,19 @@ public static partial class Http
5858
public static readonly Uri RemoteEchoServer = new Uri("http://" + Host + "/" + EchoHandler);
5959
public static readonly Uri SecureRemoteEchoServer = new Uri("https://" + SecureHost + "/" + EchoHandler);
6060
public static readonly Uri Http2RemoteEchoServer = new Uri("https://" + Http2Host + "/" + EchoHandler);
61-
public static readonly Uri[] EchoServerList = new Uri[] { RemoteEchoServer, SecureRemoteEchoServer, Http2RemoteEchoServer };
61+
public static Uri[] GetEchoServerList()
62+
{
63+
if (PlatformDetection.IsFirefox)
64+
{
65+
// https://github.com/dotnet/runtime/issues/101115
66+
return [RemoteEchoServer];
67+
}
68+
return [RemoteEchoServer, SecureRemoteEchoServer, Http2RemoteEchoServer];
69+
}
6270

6371
public static readonly Uri RemoteVerifyUploadServer = new Uri("http://" + Host + "/" + VerifyUploadHandler);
6472
public static readonly Uri SecureRemoteVerifyUploadServer = new Uri("https://" + SecureHost + "/" + VerifyUploadHandler);
6573
public static readonly Uri Http2RemoteVerifyUploadServer = new Uri("https://" + Http2Host + "/" + VerifyUploadHandler);
66-
public static readonly Uri[] VerifyUploadServerList = new Uri[] { RemoteVerifyUploadServer, SecureRemoteVerifyUploadServer, Http2RemoteVerifyUploadServer };
6774

6875
public static readonly Uri RemoteEmptyContentServer = new Uri("http://" + Host + "/" + EmptyContentHandler);
6976
public static readonly Uri RemoteDeflateServer = new Uri("http://" + Host + "/" + DeflateHandler);
@@ -72,7 +79,7 @@ public static partial class Http
7279
public static readonly Uri Http2RemoteGZipServer = new Uri("https://" + Http2Host + "/" + GZipHandler);
7380
public static Uri RemoteLoopServer => new Uri("ws://" + RemoteLoopHost + "/" + RemoteLoopHandler);
7481

75-
public static readonly object[][] EchoServers = EchoServerList.Select(x => new object[] { x }).ToArray();
82+
public static readonly object[][] EchoServers = GetEchoServerList().Select(x => new object[] { x }).ToArray();
7683
public static readonly object[][] VerifyUploadServers = { new object[] { RemoteVerifyUploadServer }, new object[] { SecureRemoteVerifyUploadServer }, new object[] { Http2RemoteVerifyUploadServer } };
7784
public static readonly object[][] CompressedServers = { new object[] { RemoteDeflateServer }, new object[] { RemoteGZipServer }, new object[] { Http2RemoteDeflateServer }, new object[] { Http2RemoteGZipServer } };
7885

@@ -83,9 +90,17 @@ public static partial class Http
8390
public static readonly RemoteServer RemoteSecureHttp11Server = new RemoteServer(new Uri("https://" + SecureHost + "/"), HttpVersion.Version11);
8491
public static readonly RemoteServer RemoteHttp2Server = new RemoteServer(new Uri("https://" + Http2Host + "/"), new Version(2, 0));
8592

86-
public static readonly IEnumerable<RemoteServer> RemoteServers = new RemoteServer[] { RemoteHttp11Server, RemoteSecureHttp11Server, RemoteHttp2Server };
93+
public static IEnumerable<RemoteServer> GetRemoteServers()
94+
{
95+
if (PlatformDetection.IsFirefox)
96+
{
97+
// https://github.com/dotnet/runtime/issues/101115
98+
return new RemoteServer[] { RemoteHttp11Server };
99+
}
100+
return new RemoteServer[] { RemoteHttp11Server, RemoteSecureHttp11Server, RemoteHttp2Server };
101+
}
87102

88-
public static readonly IEnumerable<object[]> RemoteServersMemberData = RemoteServers.Select(s => new object[] { s });
103+
public static readonly IEnumerable<object[]> RemoteServersMemberData = GetRemoteServers().Select(s => new object[] { s });
89104

90105
public sealed class RemoteServer
91106
{

0 commit comments

Comments
 (0)