Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 32e0016

Browse files
committedApr 8, 2024·
install chrome
1 parent 008ebae commit 32e0016

File tree

3 files changed

+51
-12
lines changed

3 files changed

+51
-12
lines changed
 

‎eng/testing/tests.browser.targets

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@
252252
<RunScriptCommands Include="if [[ &quot;$SCENARIO&quot; == &quot;WasmTestOnNodeJS&quot; || &quot;$SCENARIO&quot; == &quot;wasmtestonnodejs&quot; ]]; then npm ci; fi" />
253253

254254
<SetScriptCommands Condition="'$(InstallChromeForTests)' == 'true' and '$(ChromeDriverBinaryPath)' != ''" Include="export PREPEND_PATH=$([System.IO.Path]::GetDirectoryName($(ChromeDriverBinaryPath)))" />
255+
<SetScriptCommands Condition="'$(InstallFirefoxForTests)' == 'true' and '$(FirefoxBinaryPath)' != '' and '$(GeckoDriverBinaryPath)' != ''" Include="export PREPEND_PATH=$([System.IO.Path]::GetDirectoryName($(FirefoxBinaryPath))):$([System.IO.Path]::GetDirectoryName($(GeckoDriverBinaryPath)))" />
255256
<SetScriptCommands Condition="'$(IsBrowserWasmProject)' == 'true'" Include="export RuntimeIdentifier=browser-wasm" />
256257
</ItemGroup>
257258
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">

‎eng/testing/wasm-provisioning.targets

+48-12
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,31 @@
1111

1212
<!-- disable by default on unsupported platforms -->
1313
<InstallChromeForTests Condition="'$(InstallChromeForTests)' == '' and '$(ChromeOSIdentifier)' == ''">false</InstallChromeForTests>
14+
<InstallFirefoxForTests Condition="'$(InstallChromeForTests)' == '' and '$(ChromeOSIdentifier)' == ''">false</InstallFirefoxForTests>
1415
<InstallV8ForTests Condition="'$(InstallV8ForTests)' == ''">false</InstallV8ForTests>
1516

16-
<FirefoxDir>$(ArtifactsBinDir)firefox\</FirefoxDir>
17-
<FirefoxStampFile>$([MSBuild]::NormalizePath($(FirefoxDir), '.install-firefox-$(FirefoxRevision).stamp'))</FirefoxStampFile>
1817
<_BrowserStampDir>$(ArtifactsBinDir)\</_BrowserStampDir>
1918

2019
<WasmProvisionAfterTarget Condition="'$(WasmProvisionAfterTarget)' == ''">Build</WasmProvisionAfterTarget>
2120
</PropertyGroup>
2221

23-
<Import Project="$(MSBuildThisFileDirectory)ChromeVersions.props" />
24-
2522
<PropertyGroup Condition="'$(BrowserHost)' != 'windows'">
26-
<FirefoxRevision>108.0.1</FirefoxRevision>
23+
<FirefoxRevision>124.0.2</FirefoxRevision>
24+
<GeckoDriverRevision>0.34.0</GeckoDriverRevision>
2725
<FirefoxUrl>https://ftp.mozilla.org/pub/firefox/releases/$(FirefoxRevision)/linux-x86_64/en-US/firefox-$(FirefoxRevision).tar.bz2</FirefoxUrl>
26+
<GeckoDriverUrl>https://github.com/mozilla/geckodriver/releases/download/v0.34.0/geckodriver-v$(GeckoDriverRevision)-linux64.tar.gz</GeckoDriverUrl>
2827
<FirefoxBinaryName>firefox</FirefoxBinaryName>
28+
<GeckoDriverBinaryName>geckodriver</GeckoDriverBinaryName>
29+
<FirefoxDir>$(ArtifactsBinDir)firefox\</FirefoxDir>
30+
<GeckoDriverDir>$(ArtifactsBinDir)geckodriver\</GeckoDriverDir>
31+
<FirefoxStampFile>$([MSBuild]::NormalizePath($(FirefoxDir), '.install-firefox-$(FirefoxRevision).stamp'))</FirefoxStampFile>
32+
<GeckoDriverStampFile>$([MSBuild]::NormalizePath($(GeckoDriverDir), '.install-geckodriver-$(GeckoDriverRevision).stamp'))</GeckoDriverStampFile>
33+
<GeckoDriverBinaryPath>$([MSBuild]::NormalizePath($(GeckoDriverDir)))</GeckoDriverBinaryPath>
34+
<FirefoxBinaryPath>$([MSBuild]::NormalizePath($(FirefoxDir)))</FirefoxBinaryPath>
2935
</PropertyGroup>
3036

37+
<Import Project="$(MSBuildThisFileDirectory)ChromeVersions.props" />
38+
3139
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('linux'))">
3240
<ChromeDirName>chrome-linux</ChromeDirName>
3341
<ChromeDriverDirName>chromedriver_linux64</ChromeDriverDirName>
@@ -84,12 +92,6 @@
8492
<V8BinaryPath>$([MSBuild]::NormalizePath($(V8Dir), $(V8BinaryName)))</V8BinaryPath>
8593
</PropertyGroup>
8694

87-
<PropertyGroup Condition="'$(BrowserHost)' != 'windows'">
88-
<FirefoxRevision>108.0.1</FirefoxRevision>
89-
<FirefoxUrl>https://ftp.mozilla.org/pub/firefox/releases/$(FirefoxRevision)/linux-x86_64/en-US/firefox-$(FirefoxRevision).tar.bz2</FirefoxUrl>
90-
<FirefoxBinaryName>firefox</FirefoxBinaryName>
91-
</PropertyGroup>
92-
9395
<Target Name="DownloadAndInstallChrome"
9496
AfterTargets="$(WasmProvisionAfterTarget)"
9597
Condition="(!Exists($(ChromeStampFile)) or !Exists($(ChromeBinaryPath))) and '$(InstallChromeForTests)' == 'true'">
@@ -188,10 +190,13 @@ export __SCRIPT_DIR=%24( cd -- "%24( dirname -- "%24{BASH_SOURCE[0]}" )" &amp;>
188190
<Delete Files="@(_StampFile)" />
189191
<RemoveDir Directories="$(FirefoxDir)" />
190192

193+
<Message Text="** Installing firefox version $(FirefoxRevision), to: $(FirefoxDir). To disable this set the msuild property InstallFirefoxForTests=false ."
194+
Importance="High" />
195+
191196
<DownloadFile SourceUrl="$(FirefoxUrl)" DestinationFolder="$(FirefoxDir)" SkipUnchangedFiles="true">
192197
<Output TaskParameter="DownloadedFile" PropertyName="_DownloadedFile" />
193198
</DownloadFile>
194-
<Exec Command="tar -xf $(_DownloadedFile) -C $(FirefoxDir)"/>
199+
<Exec Command="tar -xf $(_DownloadedFile) -C $(FirefoxDir) --strip-components=1"/>
195200
<Exec Command="rm -rf $(_DownloadedFile)"/>
196201

197202
<PropertyGroup>
@@ -205,4 +210,35 @@ export __SCRIPT_DIR=%24( cd -- "%24( dirname -- "%24{BASH_SOURCE[0]}" )" &amp;>
205210

206211
<Touch Files="$(FirefoxStampFile)" AlwaysCreate="true" />
207212
</Target>
213+
214+
<Target Name="DownloadAndInstallGeckoDriver"
215+
AfterTargets="$(WasmProvisionAfterTarget)"
216+
Condition="!Exists($(GeckoDriverStampFile)) and '$(InstallFirefoxForTests)' == 'true' and !$([MSBuild]::IsOSPlatform('windows'))">
217+
<ItemGroup>
218+
<_StampFile Include="$(_BrowserStampDir).install-geckodriver*.stamp" />
219+
</ItemGroup>
220+
221+
<Delete Files="@(_StampFile)" />
222+
<RemoveDir Directories="$(GeckoDriverDir)" />
223+
224+
<Message Text="** Installing GeckoDriver version $(GeckoDriverRevision), to: $(GeckoDriverDir). To disable this set the msuild property InstallFirefoxForTests=false ."
225+
Importance="High" />
226+
227+
<DownloadFile SourceUrl="$(GeckoDriverUrl)" DestinationFolder="$(GeckoDriverDir)" SkipUnchangedFiles="true">
228+
<Output TaskParameter="DownloadedFile" PropertyName="_DownloadedFile" />
229+
</DownloadFile>
230+
<Exec Command="tar -xf $(_DownloadedFile) -C $(GeckoDriverDir)"/>
231+
<Exec Command="rm -rf $(_DownloadedFile)"/>
232+
233+
<PropertyGroup>
234+
<_GeckoDriverBinaryPath>$([MSBuild]::NormalizePath($(GeckoDriverDir), $(GeckoDriverBinaryName)))</_GeckoDriverBinaryPath>
235+
</PropertyGroup>
236+
237+
<Error Text="Cannot find GeckoDriver at $(_GeckoDriverBinaryPath) in the downloaded copy"
238+
Condition="!Exists($(_GeckoDriverBinaryPath))" />
239+
240+
<Exec Command="chmod +x $(_GeckoDriverBinaryPath)"/>
241+
242+
<Touch Files="$(GeckoDriverStampFile)" AlwaysCreate="true" />
243+
</Target>
208244
</Project>

‎src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<!-- to see timing and which test aborted the runtime -->
1616
<XunitShowProgress>true</XunitShowProgress>
1717
<WasmXHarnessMaxParallelThreads>1</WasmXHarnessMaxParallelThreads>
18+
<InstallFirefoxForTests>true</InstallFirefoxForTests>
19+
<InstallChromeForTests>false</InstallChromeForTests>
1820
</PropertyGroup>
1921
<!-- Make debugging easier -->
2022
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">

0 commit comments

Comments
 (0)
Please sign in to comment.