diff --git a/lib/browser/api/session.js b/lib/browser/api/session.js index 9c05886406029..347b9a6028f22 100644 --- a/lib/browser/api/session.js +++ b/lib/browser/api/session.js @@ -36,8 +36,9 @@ NetLog.prototype.startLogging = function (path, ...args) { const _originalStopLogging = NetLog.prototype.stopLogging NetLog.prototype.stopLogging = function () { + const logPath = this._currentlyLoggingPath this._currentlyLoggingPath = null - return _originalStopLogging.call(this) + return _originalStopLogging.call(this).then(() => logPath) } const currentlyLoggingPathDeprecated = deprecate.warnOnce('currentlyLoggingPath') diff --git a/spec-main/api-net-log-spec.js b/spec-main/api-net-log-spec.js index b35ca839826af..0544b8ec729fb 100644 --- a/spec-main/api-net-log-spec.js +++ b/spec-main/api-net-log-spec.js @@ -70,7 +70,8 @@ describe('netLog module', () => { expect(testNetLog().currentlyLoggingPath).to.equal(dumpFileDynamic) - await testNetLog().stopLogging() + const path = await testNetLog().stopLogging() + expect(path).to.equal(dumpFileDynamic) expect(fs.existsSync(dumpFileDynamic)).to.be.true() })