From 7163a5815c3445eaf645e4fa86254d68fe0b3a2d Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Mon, 9 Oct 2017 12:07:21 -0700 Subject: [PATCH] core(devtools-model): fix missing Runtime.experiments --- .../lib/traces/devtools-timeline-model.js | 13 ++++++++----- lighthouse-core/lib/web-inspector.js | 4 ++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lighthouse-core/lib/traces/devtools-timeline-model.js b/lighthouse-core/lib/traces/devtools-timeline-model.js index c6e45157f180..acbe8d77d7ea 100644 --- a/lighthouse-core/lib/traces/devtools-timeline-model.js +++ b/lighthouse-core/lib/traces/devtools-timeline-model.js @@ -36,11 +36,14 @@ class TimelineModel { // populate with events this._tracingModel.reset(); - ConsoleQuieter.mute({prefix: 'timelineModel'}); - this._tracingModel.addEvents(events); - this._tracingModel.tracingComplete(); - this._timelineModel.setEvents(this._tracingModel); - ConsoleQuieter.unmuteAndFlush(); + try { + ConsoleQuieter.mute({prefix: 'timelineModel'}); + this._tracingModel.addEvents(events); + this._tracingModel.tracingComplete(); + this._timelineModel.setEvents(this._tracingModel); + } finally { + ConsoleQuieter.unmuteAndFlush(); + } return this; } diff --git a/lighthouse-core/lib/web-inspector.js b/lighthouse-core/lib/web-inspector.js index a5e07cf8dbff..c10c39a065cd 100644 --- a/lighthouse-core/lib/web-inspector.js +++ b/lighthouse-core/lib/web-inspector.js @@ -26,6 +26,10 @@ module.exports = (function() { global.Runtime = global.Runtime || {}; + // Required for devtools-timeline-model + global.Runtime.experiments = global.Runtime.experiments || {}; + global.Runtime.experiments.isEnabled = global.Runtime.experiments.isEnabled || (_ => false); + const _queryParam = global.Runtime.queryParam; global.Runtime.queryParam = function(arg) { switch (arg) {