Skip to content

chore: roll to 1.23#2184

Merged
mxschmitt merged 2 commits into
microsoft:mainfrom
mxschmitt:1.23/easy
Jun 27, 2022
Merged

chore: roll to 1.23#2184
mxschmitt merged 2 commits into
microsoft:mainfrom
mxschmitt:1.23/easy

Conversation

@mxschmitt
Copy link
Copy Markdown
Contributor

No description provided.

@mxschmitt mxschmitt marked this pull request as ready for review June 27, 2022 08:38
Comment thread src/Playwright.Tests/BrowserContextLocaleTests.cs
Comment thread src/Playwright.Tests/BrowserContextServiceWorkerPolicyTests.cs
Comment thread src/Playwright.Tests/BrowserTests.cs
Comment thread src/Playwright.Tests/DefaultBrowsercontext2Tests.cs
}

[PlaywrightTest("page-network-response.spec.ts", "should report if request was fromServiceWorker")]
public async Task ShouldReportIfRequestWasFromServiceWorker()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Response = response,
Status = 201,
Body = "",
Headers = new Dictionary<string, string> {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes tests, was also made upstream the same way.

Class got renamed to align it with file name which is common in c# and we do it everywhere else.

forcedColors: options.ForcedColors).ConfigureAwait(false)).Object;

context.Options = options;
((Tracing)context.Tracing).LocalUtils = LocalUtils;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

case "crash":
Crashed?.Invoke(this, EventArgs.Empty);
break;
case "domcontentloaded":
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

});
var page = await context.NewPageAsync();
await page.GotoAsync(Server.Prefix + "/serviceworkers/empty/sw.html");
var registrationResult = await page.EvaluateAsync<object>("() => window['registrationPromise']");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make sure that service worker was actually blocked, like we do upstream.

[PlaywrightTest("browsercontext-service-worker-policy.spec.ts", "blocks service worker registration")]
public async Task ShouldBlockServiceWorkerRegistration()
{
var context = await Browser.NewContextAsync(new()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget to close the context!

@mxschmitt mxschmitt merged commit 0a409ca into microsoft:main Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants