Skip to content

Commit e36e0cf

Browse files
authored
chore: remap persistent-context options into context options (#2976)
1 parent 5651c72 commit e36e0cf

File tree

3 files changed

+3
-23
lines changed

3 files changed

+3
-23
lines changed

src/Playwright.Tests/ClientCertficatesTests.cs

-4
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ public async Task ShouldWorkWithNewContext()
118118
{
119119
var context = await Browser.NewContextAsync(new()
120120
{
121-
// TODO: Remove this once we can pass a custom CA.
122121
IgnoreHTTPSErrors = true,
123122
ClientCertificates =
124123
[
@@ -153,7 +152,6 @@ public async Task ShouldWorkWithNewPage()
153152
{
154153
var page = await Browser.NewPageAsync(new()
155154
{
156-
// TODO: Remove this once we can pass a custom CA.
157155
IgnoreHTTPSErrors = true,
158156
ClientCertificates =
159157
[
@@ -181,7 +179,6 @@ public async Task ShouldWorkWithLaunchPersistentContext()
181179
{
182180
var context = await BrowserType.LaunchPersistentContextAsync("", new()
183181
{
184-
// TODO: Remove this once we can pass a custom CA.
185182
IgnoreHTTPSErrors = true,
186183
ClientCertificates =
187184
[
@@ -210,7 +207,6 @@ public async Task ShouldWorkWithAPIRequestContext()
210207
{
211208
var request = await Playwright.APIRequest.NewContextAsync(new()
212209
{
213-
// TODO: Remove this once we can pass a custom CA.
214210
IgnoreHTTPSErrors = true,
215211
ClientCertificates =
216212
[

src/Playwright.Tests/PageRouteTests.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,9 @@ await Page.RouteAsync("**/*", (route) =>
513513
route.ContinueAsync();
514514
requests.Add(route.Request);
515515
});
516-
var response = await Page.GotoAsync($"data:text/html,<link rel=\"stylesheet\" href=\"{Server.EmptyPage}/fonts?helvetica|arial\"/>");
516+
var response = await Page.GotoAsync($"data:text/html,<meta charset=utf-8><link rel=\"stylesheet\" href=\"{Server.EmptyPage}/fonts?helvetica|arial\"/>");
517517
Assert.Null(response);
518-
// TODO: https://github.com/microsoft/playwright/issues/12789
519-
if (TestConstants.IsFirefox)
520-
Assert.That(requests, Has.Count.EqualTo(2));
521-
else
522-
Assert.That(requests, Has.Count.EqualTo(1));
518+
Assert.That(requests, Has.Count.EqualTo(1));
523519
Assert.AreEqual((int)HttpStatusCode.NotFound, (await requests[0].ResponseAsync()).Status);
524520
}
525521

src/Playwright/Core/BrowserType.cs

+1-13
Original file line numberDiff line numberDiff line change
@@ -158,21 +158,9 @@ public async Task<IBrowserContext> LaunchPersistentContextAsync(string userDataD
158158

159159
var context = await SendMessageToServerAsync<BrowserContext>("launchPersistentContext", channelArgs).ConfigureAwait(false);
160160

161-
// TODO: unite with a single browser context options type which is derived from channels
162161
DidCreateContext(
163162
context,
164-
new()
165-
{
166-
RecordVideoDir = options.RecordVideoDir,
167-
RecordVideoSize = options.RecordVideoSize,
168-
RecordHarContent = options.RecordHarContent,
169-
RecordHarMode = options.RecordHarMode,
170-
RecordHarOmitContent = options.RecordHarOmitContent,
171-
RecordHarPath = options.RecordHarPath,
172-
RecordHarUrlFilter = options.RecordHarUrlFilter,
173-
RecordHarUrlFilterString = options.RecordHarUrlFilterString,
174-
RecordHarUrlFilterRegex = options.RecordHarUrlFilterRegex,
175-
},
163+
ClassUtils.Clone<BrowserNewContextOptions>(options),
176164
options?.TracesDir);
177165

178166
return context;

0 commit comments

Comments
 (0)