mirror of
https://github.com/microsoft/playwright-java.git
synced 2025-09-08 21:01:00 +00:00
fix: unflake exposeBindingHandleShouldNotThrowDuringNavigation (#37)
This commit is contained in:
parent
5f578aae41
commit
f9fc50b6de
@ -187,15 +187,19 @@ public class PageImpl extends ChannelOwner implements Page {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addListener(EventType type, Listener<EventType> listener) {
|
public void addListener(EventType type, Listener<EventType> listener) {
|
||||||
|
if (type == EventType.FILECHOOSER) {
|
||||||
willAddFileChooserListener();
|
willAddFileChooserListener();
|
||||||
|
}
|
||||||
listeners.add(type, listener);
|
listeners.add(type, listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeListener(EventType type, Listener<EventType> listener) {
|
public void removeListener(EventType type, Listener<EventType> listener) {
|
||||||
listeners.remove(type, listener);
|
listeners.remove(type, listener);
|
||||||
|
if (type == EventType.FILECHOOSER) {
|
||||||
didRemoveFileChooserListener();
|
didRemoveFileChooserListener();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close(CloseOptions options) {
|
public void close(CloseOptions options) {
|
||||||
|
@ -47,6 +47,12 @@ public class TestBase {
|
|||||||
headful = false;
|
headful = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AfterAll
|
||||||
|
static void closeBrowser() {
|
||||||
|
browser.close();
|
||||||
|
browser = null;
|
||||||
|
}
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void startServer() throws IOException {
|
static void startServer() throws IOException {
|
||||||
server = Server.createHttp(8907);
|
server = Server.createHttp(8907);
|
||||||
@ -55,7 +61,6 @@ public class TestBase {
|
|||||||
|
|
||||||
@AfterAll
|
@AfterAll
|
||||||
static void stopServer() throws IOException {
|
static void stopServer() throws IOException {
|
||||||
browser.close();
|
|
||||||
server.stop();
|
server.stop();
|
||||||
server = null;
|
server = null;
|
||||||
httpsServer.stop();
|
httpsServer.stop();
|
||||||
@ -63,7 +68,7 @@ public class TestBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setUp() {
|
void createContextAndPage() {
|
||||||
server.reset();
|
server.reset();
|
||||||
httpsServer.reset();
|
httpsServer.reset();
|
||||||
context = browser.newContext();
|
context = browser.newContext();
|
||||||
@ -71,7 +76,7 @@ public class TestBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
void tearDown() {
|
void closeContext() {
|
||||||
context.close();
|
context.close();
|
||||||
context = null;
|
context = null;
|
||||||
page = null;
|
page = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user