|
@@ -434,15 +434,15 @@ describe('<webview> tag', function () {
|
|
|
return [w, webview];
|
|
|
};
|
|
|
|
|
|
- afterEach(closeAllWindows);
|
|
|
afterEach(async () => {
|
|
|
// The leaving animation is un-observable but can interfere with future tests
|
|
|
// Specifically this is async on macOS but can be on other platforms too
|
|
|
await delay(1000);
|
|
|
+
|
|
|
+ closeAllWindows();
|
|
|
});
|
|
|
|
|
|
- // TODO(jkleinsc) fix this test on arm64 macOS. It causes the tests following it to fail/be flaky
|
|
|
- ifit(process.platform !== 'darwin' || process.arch !== 'arm64')('should make parent frame element fullscreen too', async () => {
|
|
|
+ it('should make parent frame element fullscreen too', async () => {
|
|
|
const [w, webview] = await loadWebViewWindow();
|
|
|
expect(await w.webContents.executeJavaScript('isIframeFullscreen()')).to.be.false();
|
|
|
|
|
@@ -450,11 +450,13 @@ describe('<webview> tag', function () {
|
|
|
await webview.executeJavaScript('document.getElementById("div").requestFullscreen()', true);
|
|
|
await parentFullscreen;
|
|
|
expect(await w.webContents.executeJavaScript('isIframeFullscreen()')).to.be.true();
|
|
|
+
|
|
|
+ w.close();
|
|
|
+ await emittedOnce(w, 'closed');
|
|
|
});
|
|
|
|
|
|
// FIXME(zcbenz): Fullscreen events do not work on Linux.
|
|
|
- // This test is flaky on arm64 macOS.
|
|
|
- ifit(process.platform !== 'linux' && process.arch !== 'arm64')('exiting fullscreen should unfullscreen window', async () => {
|
|
|
+ ifit(process.platform !== 'linux')('exiting fullscreen should unfullscreen window', async () => {
|
|
|
const [w, webview] = await loadWebViewWindow();
|
|
|
const enterFullScreen = emittedOnce(w, 'enter-full-screen');
|
|
|
await webview.executeJavaScript('document.getElementById("div").requestFullscreen()', true);
|
|
@@ -465,6 +467,9 @@ describe('<webview> tag', function () {
|
|
|
await leaveFullScreen;
|
|
|
await delay(0);
|
|
|
expect(w.isFullScreen()).to.be.false();
|
|
|
+
|
|
|
+ w.close();
|
|
|
+ await emittedOnce(w, 'closed');
|
|
|
});
|
|
|
|
|
|
// Sending ESC via sendInputEvent only works on Windows.
|
|
@@ -479,6 +484,9 @@ describe('<webview> tag', function () {
|
|
|
await leaveFullScreen;
|
|
|
await delay(0);
|
|
|
expect(w.isFullScreen()).to.be.false();
|
|
|
+
|
|
|
+ w.close();
|
|
|
+ await emittedOnce(w, 'closed');
|
|
|
});
|
|
|
|
|
|
it('pressing ESC should emit the leave-html-full-screen event', async () => {
|
|
@@ -507,6 +515,9 @@ describe('<webview> tag', function () {
|
|
|
webContents.sendInputEvent({ type: 'keyDown', keyCode: 'Escape' });
|
|
|
await leaveFSWindow;
|
|
|
await leaveFSWebview;
|
|
|
+
|
|
|
+ w.close();
|
|
|
+ await emittedOnce(w, 'closed');
|
|
|
});
|
|
|
});
|
|
|
|