OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @typedef {{ | 6 * @typedef {{ |
7 * lighthouseVersion: !string, | 7 * lighthouseVersion: !string, |
8 * generatedTime: !string, | 8 * generatedTime: !string, |
9 * initialUrl: !string, | 9 * initialUrl: !string, |
10 * url: !string, | 10 * url: !string, |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 this._statusElement.textContent = statusMessage; | 135 this._statusElement.textContent = statusMessage; |
136 } | 136 } |
137 | 137 |
138 /** | 138 /** |
139 * @return {!Promise<undefined>} | 139 * @return {!Promise<undefined>} |
140 */ | 140 */ |
141 _stop() { | 141 _stop() { |
142 return this._protocolService.detach().then(_ => { | 142 return this._protocolService.detach().then(_ => { |
143 this._auditRunning = false; | 143 this._auditRunning = false; |
144 this._updateButton(); | 144 this._updateButton(); |
145 if (this._inspectedURL !== SDK.targetManager.mainTarget().inspectedURL()) | 145 var resourceTreeModel = SDK.targetManager.mainTarget().model(SDK.ResourceT
reeModel); |
146 SDK.targetManager.mainTarget().pageAgent().navigate(this._inspectedURL); | 146 if (resourceTreeModel && this._inspectedURL !== SDK.targetManager.mainTarg
et().inspectedURL()) |
| 147 resourceTreeModel.navigate(this._inspectedURL); |
147 | 148 |
148 }); | 149 }); |
149 } | 150 } |
150 | 151 |
151 /** | 152 /** |
152 * @param {!Audits2.WorkerResult} workerResult | 153 * @param {!Audits2.WorkerResult} workerResult |
153 */ | 154 */ |
154 _finish(workerResult) { | 155 _finish(workerResult) { |
155 if (workerResult === null) { | 156 if (workerResult === null) { |
156 this._updateStatus(Common.UIString('Auditing failed.')); | 157 this._updateStatus(Common.UIString('Auditing failed.')); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 * @param {!Object=} params | 284 * @param {!Object=} params |
284 * @return {!Promise<!Audits2.WorkerResult|undefined>} | 285 * @return {!Promise<!Audits2.WorkerResult|undefined>} |
285 */ | 286 */ |
286 _send(method, params) { | 287 _send(method, params) { |
287 if (!this._backendPromise) | 288 if (!this._backendPromise) |
288 this._initWorker(); | 289 this._initWorker(); |
289 | 290 |
290 return this._backendPromise.then(_ => this._backend.send(method, params)); | 291 return this._backendPromise.then(_ => this._backend.send(method, params)); |
291 } | 292 } |
292 }; | 293 }; |
OLD | NEW |