Skip to content

Commit dd8a818

Browse files
authored
Merge branch 'master' into v19
2 parents 77c61ce + 78e2cf3 commit dd8a818

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

.github/workflows/dotnet.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
- name: Test (Linux)
9191
if: matrix.os == 'ubuntu-latest'
9292
env:
93-
PRODUCT: ${{ matrix.browser }}
93+
BROWSER: ${{ matrix.browser }}
9494
HEADLESS_MODE: ${{ matrix.mode }}
9595
run: |
9696
Xvfb :1 -screen 5 1024x768x8 &
@@ -100,7 +100,7 @@ jobs:
100100
- name: Test (Windows)
101101
if: matrix.os == 'windows-latest'
102102
env:
103-
PRODUCT: ${{ matrix.browser }}
103+
BROWSER: ${{ matrix.browser }}
104104
HEADLESS_MODE: ${{ matrix.mode }}
105105
run: |
106106
cd .\lib\PuppeteerSharp.Tests

lib/PuppeteerSharp.Nunit/PuppeteerTestAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class PuppeteerTestAttribute : NUnitAttribute, IApplyToTest
2121
{
2222
private static TestExpectation[] _localExpectations;
2323
private static TestExpectation[] _upstreamExpectations;
24-
public static readonly bool IsChrome = Environment.GetEnvironmentVariable("PRODUCT") != "FIREFOX";
24+
public static readonly bool IsChrome = Environment.GetEnvironmentVariable("BROWSER") != "FIREFOX";
2525
// TODO: Change implementation when we implement Webdriver Bidi
2626
public static readonly bool IsCdp = true;
2727
public static readonly HeadlessMode Headless =

lib/PuppeteerSharp/BrowserFetcher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ internal static string GetBrowsersLocation()
206206
return assemblyDirectory.FullName;
207207
}
208208

209-
private static string GetDownloadURL(SupportedBrowser product, Platform platform, string baseUrl, string buildId)
210-
=> _downloadsUrl[product](platform, buildId, baseUrl);
209+
private static string GetDownloadURL(SupportedBrowser browser, Platform platform, string baseUrl, string buildId)
210+
=> _downloadsUrl[browser](platform, buildId, baseUrl);
211211

212212
private static void ExtractTar(string zipPath, string folderPath)
213213
{

lib/PuppeteerSharp/BrowserFetcherOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class BrowserFetcherOptions
1616
public delegate Task CustomFileDownloadAction(string address, string fileName);
1717

1818
/// <summary>
19-
/// Product. Defaults to Chrome.
19+
/// Browser. Defaults to Chrome.
2020
/// </summary>
2121
public SupportedBrowser Browser { get; set; } = SupportedBrowser.Chrome;
2222

lib/PuppeteerSharp/LaunchOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public bool Headless
5353
/// <summary>
5454
/// Additional arguments to pass to the browser instance. List of Chromium flags can be found <a href="http://peter.sh/experiments/chromium-command-line-switches/">here</a>.
5555
/// </summary>
56-
public string[] Args { get; set; } = Array.Empty<string>();
56+
public string[] Args { get; set; } = [];
5757

5858
/// <summary>
5959
/// Maximum time in milliseconds to wait for the browser instance to start. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.

lib/PuppeteerSharp/Launcher.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public async Task<IBrowser> LaunchAsync(LaunchOptions options)
6464
{
6565
SupportedBrowser.Chrome or SupportedBrowser.Chromium => new ChromeLauncher(executable, options),
6666
SupportedBrowser.Firefox => new FirefoxLauncher(executable, options),
67-
_ => throw new ArgumentException("Invalid product"),
67+
_ => throw new ArgumentException("Invalid browser"),
6868
};
6969

7070
try
@@ -136,14 +136,14 @@ public async Task<IBrowser> ConnectAsync(ConnectOptions options)
136136

137137
var version = await connection.SendAsync<BrowserGetVersionResponse>("Browser.getVersion").ConfigureAwait(false);
138138

139-
var product = version.Product.ToLower(CultureInfo.CurrentCulture).Contains("firefox")
139+
var browser = version.Product.ToLower(CultureInfo.CurrentCulture).Contains("firefox")
140140
? SupportedBrowser.Firefox
141141
: SupportedBrowser.Chromium;
142142

143143
var response = await connection.SendAsync<GetBrowserContextsResponse>("Target.getBrowserContexts").ConfigureAwait(false);
144144
return await CdpBrowser
145145
.CreateAsync(
146-
product,
146+
browser,
147147
connection,
148148
response.BrowserContextIds,
149149
options.AcceptInsecureCerts,

0 commit comments

Comments
 (0)