Skip to content

Commit b3ea344

Browse files
committed
Remove dispose service param from chromium ctor
1 parent 0c6699e commit b3ea344

File tree

3 files changed

+5
-23
lines changed

3 files changed

+5
-23
lines changed

dotnet/src/webdriver/Chrome/ChromeDriver.cs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public ChromeDriver(string chromeDriverDirectory, ChromeOptions options)
125125
/// <param name="options">The <see cref="ChromeOptions"/> to be used with the Chrome driver.</param>
126126
/// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
127127
public ChromeDriver(string chromeDriverDirectory, ChromeOptions options, TimeSpan commandTimeout)
128-
: this(ChromeDriverService.CreateDefaultService(chromeDriverDirectory), options, commandTimeout, disposeService: true)
128+
: this(ChromeDriverService.CreateDefaultService(chromeDriverDirectory), options, commandTimeout)
129129
{
130130
}
131131

@@ -136,12 +136,7 @@ public ChromeDriver(string chromeDriverDirectory, ChromeOptions options, TimeSpa
136136
/// <param name="service">The <see cref="ChromeDriverService"/> to use.</param>
137137
/// <param name="options">The <see cref="ChromeOptions"/> used to initialize the driver.</param>
138138
public ChromeDriver(ChromeDriverService service, ChromeOptions options)
139-
: this(service, options, RemoteWebDriver.DefaultCommandTimeout, disposeService: true)
140-
{
141-
}
142-
143-
public ChromeDriver(ChromeDriverService service, ChromeOptions options, bool disposeService)
144-
: this(service, options, RemoteWebDriver.DefaultCommandTimeout, disposeService)
139+
: this(service, options, RemoteWebDriver.DefaultCommandTimeout)
145140
{
146141
}
147142

@@ -152,13 +147,7 @@ public ChromeDriver(ChromeDriverService service, ChromeOptions options, bool dis
152147
/// <param name="options">The <see cref="ChromeOptions"/> to be used with the Chrome driver.</param>
153148
/// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
154149
public ChromeDriver(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
155-
: base(service, options, commandTimeout, disposeService: true)
156-
{
157-
this.AddCustomChromeCommands();
158-
}
159-
160-
public ChromeDriver(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout, bool disposeService)
161-
: base(service, options, commandTimeout, disposeService)
150+
: base(service, options, commandTimeout)
162151
{
163152
this.AddCustomChromeCommands();
164153
}

dotnet/src/webdriver/Chromium/ChromiumDriver.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public class ChromiumDriver : WebDriver, ISupportsLogs, IDevTools
107107
public static readonly string SetPermissionCommand = "setPermission";
108108

109109
private readonly ChromiumDriverService driverService;
110-
private readonly bool disposeDriverService;
111110
private readonly string optionsCapabilityName;
112111
private DevToolsSession devToolsSession;
113112

@@ -128,11 +127,10 @@ public class ChromiumDriver : WebDriver, ISupportsLogs, IDevTools
128127
/// <param name="service">The <see cref="ChromiumDriverService"/> to use.</param>
129128
/// <param name="options">The <see cref="ChromiumOptions"/> to be used with the ChromiumDriver.</param>
130129
/// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
131-
protected ChromiumDriver(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout, bool disposeService)
130+
protected ChromiumDriver(ChromiumDriverService service, ChromiumOptions options, TimeSpan commandTimeout)
132131
: base(StartDriverServiceCommandExecutor(service, options, commandTimeout), ConvertOptionsToCapabilities(options))
133132
{
134133
this.driverService = service;
135-
this.disposeDriverService = disposeService;
136134
this.optionsCapabilityName = options.CapabilityName;
137135
}
138136

@@ -471,11 +469,6 @@ protected override void Dispose(bool disposing)
471469
}
472470

473471
base.Dispose(disposing);
474-
475-
if (this.disposeDriverService)
476-
{
477-
this.driverService?.Dispose();
478-
}
479472
}
480473

481474
private static ICapabilities ConvertOptionsToCapabilities(ChromiumOptions options)

dotnet/src/webdriver/Edge/EdgeDriver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public EdgeDriver(EdgeDriverService service, EdgeOptions options)
117117
/// <param name="options">The <see cref="EdgeOptions"/> to be used with the Edge driver.</param>
118118
/// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
119119
public EdgeDriver(EdgeDriverService service, EdgeOptions options, TimeSpan commandTimeout)
120-
: base(service, options, commandTimeout, disposeService: false)
120+
: base(service, options, commandTimeout)
121121
{
122122
this.AddCustomEdgeCommands();
123123
}

0 commit comments

Comments
 (0)