From 6b2f4ca48ddd4c072ca9fec494f37f22758322fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Lach=C3=A8ze?= Date: Fri, 10 May 2019 01:18:49 +0200 Subject: [PATCH] Revert "Modify tests about zoom persistence to properly simulate cross-origin navigation" This reverts commit 0a7537f2eb7f183ddec16637e8a2e92a0d600321. --- spec/api-web-contents-spec.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/spec/api-web-contents-spec.js b/spec/api-web-contents-spec.js index a500250203083..726deadd71f4a 100644 --- a/spec/api-web-contents-spec.js +++ b/spec/api-web-contents-spec.js @@ -7,7 +7,6 @@ const http = require('http') const path = require('path') const { closeWindow } = require('./window-helpers') const { emittedOnce } = require('./events-helpers') -const { createNetworkSandbox } = require('./network-helper') const chai = require('chai') const dirtyChai = require('dirty-chai') @@ -741,11 +740,6 @@ describe('webContents module', () => { }) it('cannot persist zoom level after navigation with webFrame', (done) => { - const protocol = session.defaultSession.protocol - const sandbox = createNetworkSandbox(protocol) - sandbox.serveFileFromProtocol('ccc', path.join(fixtures, 'pages', 'c.html')) - sandbox.serveFileFromProtocol('ddd', path.join(fixtures, 'pages', 'd.html')) - let initialNavigation = true const source = ` const {ipcRenderer, webFrame} = require('electron') @@ -758,16 +752,15 @@ describe('webContents module', () => { } else { const zoomLevel = w.webContents.getZoomLevel() expect(zoomLevel).to.equal(0) - sandbox.reset() done() } }) ipcMain.once('zoom-level-set', (e, zoomLevel) => { expect(zoomLevel).to.equal(0.6) - w.loadURL('ddd://page') + w.loadFile(path.join(fixtures, 'pages', 'd.html')) initialNavigation = false }) - w.loadURL('ccc://page') + w.loadFile(path.join(fixtures, 'pages', 'c.html')) }) })