Skip to content

Commit

Permalink
chore: remap persistent-context options into context options (#2976)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Aug 5, 2024
1 parent 5651c72 commit e36e0cf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
4 changes: 0 additions & 4 deletions src/Playwright.Tests/ClientCertficatesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public async Task ShouldWorkWithNewContext()
{
var context = await Browser.NewContextAsync(new()
{
// TODO: Remove this once we can pass a custom CA.
IgnoreHTTPSErrors = true,
ClientCertificates =
[
Expand Down Expand Up @@ -153,7 +152,6 @@ public async Task ShouldWorkWithNewPage()
{
var page = await Browser.NewPageAsync(new()
{
// TODO: Remove this once we can pass a custom CA.
IgnoreHTTPSErrors = true,
ClientCertificates =
[
Expand Down Expand Up @@ -181,7 +179,6 @@ public async Task ShouldWorkWithLaunchPersistentContext()
{
var context = await BrowserType.LaunchPersistentContextAsync("", new()
{
// TODO: Remove this once we can pass a custom CA.
IgnoreHTTPSErrors = true,
ClientCertificates =
[
Expand Down Expand Up @@ -210,7 +207,6 @@ public async Task ShouldWorkWithAPIRequestContext()
{
var request = await Playwright.APIRequest.NewContextAsync(new()
{
// TODO: Remove this once we can pass a custom CA.
IgnoreHTTPSErrors = true,
ClientCertificates =
[
Expand Down
8 changes: 2 additions & 6 deletions src/Playwright.Tests/PageRouteTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,9 @@ await Page.RouteAsync("**/*", (route) =>
route.ContinueAsync();
requests.Add(route.Request);
});
var response = await Page.GotoAsync($"data:text/html,<link rel=\"stylesheet\" href=\"{Server.EmptyPage}/fonts?helvetica|arial\"/>");
var response = await Page.GotoAsync($"data:text/html,<meta charset=utf-8><link rel=\"stylesheet\" href=\"{Server.EmptyPage}/fonts?helvetica|arial\"/>");
Assert.Null(response);
// TODO: https://github.com/microsoft/playwright/issues/12789
if (TestConstants.IsFirefox)
Assert.That(requests, Has.Count.EqualTo(2));
else
Assert.That(requests, Has.Count.EqualTo(1));
Assert.That(requests, Has.Count.EqualTo(1));
Assert.AreEqual((int)HttpStatusCode.NotFound, (await requests[0].ResponseAsync()).Status);
}

Expand Down
14 changes: 1 addition & 13 deletions src/Playwright/Core/BrowserType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,9 @@ public async Task<IBrowserContext> LaunchPersistentContextAsync(string userDataD

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

// TODO: unite with a single browser context options type which is derived from channels
DidCreateContext(
context,
new()
{
RecordVideoDir = options.RecordVideoDir,
RecordVideoSize = options.RecordVideoSize,
RecordHarContent = options.RecordHarContent,
RecordHarMode = options.RecordHarMode,
RecordHarOmitContent = options.RecordHarOmitContent,
RecordHarPath = options.RecordHarPath,
RecordHarUrlFilter = options.RecordHarUrlFilter,
RecordHarUrlFilterString = options.RecordHarUrlFilterString,
RecordHarUrlFilterRegex = options.RecordHarUrlFilterRegex,
},
ClassUtils.Clone<BrowserNewContextOptions>(options),
options?.TracesDir);

return context;
Expand Down

0 comments on commit e36e0cf

Please sign in to comment.