Skip to content

Commit 8fd8f1c

Browse files
authored
test: remove per-context proxy hacks for Windows/Chromium (#1668)
1 parent 7d20666 commit 8fd8f1c

File tree

3 files changed

+1
-33
lines changed

3 files changed

+1
-33
lines changed

playwright/src/test/java/com/microsoft/playwright/TestBrowserContextFetch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void shouldWorkWithContextLevelProxy() throws ExecutionException, InterruptedExc
218218
writer.write("<title>Served by the proxy</title>");
219219
}
220220
});
221-
try (Browser browser = browserType.launch(new BrowserType.LaunchOptions().setProxy("http://per-context"))) {
221+
try (Browser browser = browserType.launch()) {
222222
BrowserContext context = browser.newContext(new Browser.NewContextOptions().setProxy("localhost:" + server.PORT));
223223
Future<Server.Request> request = server.futureRequest("/target.html");
224224
APIResponse response = context.request().get("http://non-existent.com/target.html");

playwright/src/test/java/com/microsoft/playwright/TestBrowserContextProxy.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,6 @@
2929
import static org.junit.jupiter.api.Assertions.*;
3030

3131
public class TestBrowserContextProxy extends TestBase {
32-
33-
@Override
34-
@BeforeAll
35-
// Hide base class method to provide extra option.
36-
void launchBrowser() {
37-
BrowserType.LaunchOptions options = createLaunchOptions();
38-
options.setProxy(new Proxy("per-context"));
39-
launchBrowser(options);
40-
}
41-
42-
static boolean isChromiumWindows() {
43-
return isChromium() && isWindows;
44-
}
45-
46-
@Test
47-
@EnabledIf(value="isChromiumWindows", disabledReason="Platform-specific")
48-
void shouldThrowForMissingGlobalProxyOnChromiumWindows() {
49-
try (Browser browser = browserType.launch(createLaunchOptions())) {
50-
PlaywrightException e = assertThrows(PlaywrightException.class, () -> {
51-
browser.newContext(new Browser.NewContextOptions().setProxy("localhost:" + server.PORT));
52-
});
53-
assertTrue(e.getMessage().contains("Browser needs to be launched with the global proxy"));
54-
}
55-
}
56-
5732
void shouldThrowForBadServerValue() {
5833
// Enforced by compiler in Java
5934
}

playwright/src/test/java/com/microsoft/playwright/TestClientCertificates.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,6 @@ void stopServer() {
5757
super.stopServer();
5858
}
5959

60-
@BeforeAll
61-
@Override
62-
void launchBrowser() {
63-
// TODO: remove once Chromium Stable tests pass without it on Windows.
64-
launchBrowser(createLaunchOptions().setProxy(new Proxy("per-context")));
65-
}
66-
6760
@Test
6861
public void shouldFailWithNoClientCertificatesProvided() {
6962
APIRequestContext request = playwright.request().newContext(

0 commit comments

Comments
 (0)