fix: unflake exposeBindingHandleShouldNotThrowDuringNavigation (#37)

This commit is contained in:
Yury Semikhatsky 2020-10-23 12:18:40 -07:00 committed by GitHub
parent 5f578aae41
commit f9fc50b6de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 49 deletions

View File

@ -187,15 +187,19 @@ public class PageImpl extends ChannelOwner implements Page {
@Override
public void addListener(EventType type, Listener<EventType> listener) {
if (type == EventType.FILECHOOSER) {
willAddFileChooserListener();
}
listeners.add(type, listener);
}
@Override
public void removeListener(EventType type, Listener<EventType> listener) {
listeners.remove(type, listener);
if (type == EventType.FILECHOOSER) {
didRemoveFileChooserListener();
}
}
@Override
public void close(CloseOptions options) {

View File

@ -47,6 +47,12 @@ public class TestBase {
headful = false;
}
@AfterAll
static void closeBrowser() {
browser.close();
browser = null;
}
@BeforeAll
static void startServer() throws IOException {
server = Server.createHttp(8907);
@ -55,7 +61,6 @@ public class TestBase {
@AfterAll
static void stopServer() throws IOException {
browser.close();
server.stop();
server = null;
httpsServer.stop();
@ -63,7 +68,7 @@ public class TestBase {
}
@BeforeEach
void setUp() {
void createContextAndPage() {
server.reset();
httpsServer.reset();
context = browser.newContext();
@ -71,7 +76,7 @@ public class TestBase {
}
@AfterEach
void tearDown() {
void closeContext() {
context.close();
context = null;
page = null;