Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | /** |
| 6 | * @implements {SDK.SDKModelObserver<!SDK.ServiceWorkerManager>} |
| 7 | * @unrestricted |
| 8 | */ |
Paul Lewis | cf2ef22 | 2019-11-22 14:55:35 +0000 | [diff] [blame] | 9 | class AuditController extends Common.Object { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 10 | constructor(protocolService) { |
| 11 | super(); |
| 12 | |
| 13 | protocolService.registerStatusCallback( |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 14 | message => this.dispatchEventToListeners(Audits.Events.AuditProgressChanged, {message})); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 15 | |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 16 | for (const preset of Audits.Presets) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 17 | preset.setting.addChangeListener(this.recomputePageAuditability.bind(this)); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 18 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 19 | |
| 20 | SDK.targetManager.observeModels(SDK.ServiceWorkerManager, this); |
| 21 | SDK.targetManager.addEventListener( |
| 22 | SDK.TargetManager.Events.InspectedURLChanged, this.recomputePageAuditability, this); |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * @override |
| 27 | * @param {!SDK.ServiceWorkerManager} serviceWorkerManager |
| 28 | */ |
| 29 | modelAdded(serviceWorkerManager) { |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 30 | if (this._manager) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 31 | return; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 32 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 33 | |
| 34 | this._manager = serviceWorkerManager; |
| 35 | this._serviceWorkerListeners = [ |
| 36 | this._manager.addEventListener( |
| 37 | SDK.ServiceWorkerManager.Events.RegistrationUpdated, this.recomputePageAuditability, this), |
| 38 | this._manager.addEventListener( |
| 39 | SDK.ServiceWorkerManager.Events.RegistrationDeleted, this.recomputePageAuditability, this), |
| 40 | ]; |
| 41 | |
| 42 | this.recomputePageAuditability(); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * @override |
| 47 | * @param {!SDK.ServiceWorkerManager} serviceWorkerManager |
| 48 | */ |
| 49 | modelRemoved(serviceWorkerManager) { |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 50 | if (this._manager !== serviceWorkerManager) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 51 | return; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 52 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 53 | |
| 54 | Common.EventTarget.removeEventListeners(this._serviceWorkerListeners); |
| 55 | this._manager = null; |
| 56 | this.recomputePageAuditability(); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @return {boolean} |
| 61 | */ |
| 62 | _hasActiveServiceWorker() { |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 63 | if (!this._manager) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 64 | return false; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 65 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 66 | |
| 67 | const mainTarget = this._manager.target(); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 68 | if (!mainTarget) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 69 | return false; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 70 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 71 | |
Peter Marshall | 3e4e569 | 2019-12-09 17:48:04 +0100 | [diff] [blame] | 72 | const inspectedURL = Common.ParsedURL.fromString(mainTarget.inspectedURL()); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 73 | const inspectedOrigin = inspectedURL && inspectedURL.securityOrigin(); |
| 74 | for (const registration of this._manager.registrations().values()) { |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 75 | if (registration.securityOrigin !== inspectedOrigin) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 76 | continue; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 77 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 78 | |
| 79 | for (const version of registration.versions.values()) { |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 80 | if (version.controlledClients.length > 1) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 81 | return true; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 82 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 83 | } |
| 84 | } |
| 85 | |
| 86 | return false; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * @return {boolean} |
| 91 | */ |
| 92 | _hasAtLeastOneCategory() { |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 93 | return Audits.Presets.some(preset => preset.setting.get()); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | /** |
| 97 | * @return {?string} |
| 98 | */ |
| 99 | _unauditablePageMessage() { |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 100 | if (!this._manager) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 101 | return null; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 102 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 103 | |
| 104 | const mainTarget = this._manager.target(); |
| 105 | const inspectedURL = mainTarget && mainTarget.inspectedURL(); |
| 106 | if (inspectedURL && !/^(http|chrome-extension)/.test(inspectedURL)) { |
| 107 | return Common.UIString( |
Lorne Mitchell | 7aa2c6c | 2019-04-03 03:50:10 +0000 | [diff] [blame] | 108 | 'Can only audit HTTP/HTTPS pages and Chrome extensions. Navigate to a different page to start an audit.'); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 109 | } |
| 110 | |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 111 | return null; |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * @return {!Promise<string>} |
| 116 | */ |
| 117 | async _evaluateInspectedURL() { |
| 118 | const mainTarget = this._manager.target(); |
| 119 | const runtimeModel = mainTarget.model(SDK.RuntimeModel); |
| 120 | const executionContext = runtimeModel && runtimeModel.defaultExecutionContext(); |
| 121 | let inspectedURL = mainTarget.inspectedURL(); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 122 | if (!executionContext) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 123 | return inspectedURL; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 124 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 125 | |
| 126 | // Evaluate location.href for a more specific URL than inspectedURL provides so that SPA hash navigation routes |
| 127 | // will be respected and audited. |
| 128 | try { |
| 129 | const result = await executionContext.evaluate( |
| 130 | { |
| 131 | expression: 'window.location.href', |
| 132 | objectGroup: 'audits', |
| 133 | includeCommandLineAPI: false, |
| 134 | silent: false, |
| 135 | returnByValue: true, |
| 136 | generatePreview: false |
| 137 | }, |
| 138 | /* userGesture */ false, /* awaitPromise */ false); |
| 139 | if (!result.exceptionDetails && result.object) { |
| 140 | inspectedURL = result.object.value; |
| 141 | result.object.release(); |
| 142 | } |
| 143 | } catch (err) { |
| 144 | console.error(err); |
| 145 | } |
| 146 | |
| 147 | return inspectedURL; |
| 148 | } |
| 149 | |
| 150 | /** |
| 151 | * @return {!Object} |
| 152 | */ |
| 153 | getFlags() { |
Connor Clark | 3f70034 | 2019-07-25 02:10:41 +0000 | [diff] [blame] | 154 | const flags = { |
| 155 | // DevTools handles all the emulation. This tells Lighthouse to not bother with emulation. |
Connor Clark | 3ee5ac7 | 2019-11-07 15:11:58 -0800 | [diff] [blame] | 156 | internalDisableDeviceScreenEmulation: true |
Connor Clark | 3f70034 | 2019-07-25 02:10:41 +0000 | [diff] [blame] | 157 | }; |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 158 | for (const runtimeSetting of Audits.RuntimeSettings) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 159 | runtimeSetting.setFlags(flags, runtimeSetting.setting.get()); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 160 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 161 | return flags; |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * @return {!Array<string>} |
| 166 | */ |
| 167 | getCategoryIDs() { |
| 168 | const categoryIDs = []; |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 169 | for (const preset of Audits.Presets) { |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 170 | if (preset.setting.get()) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 171 | categoryIDs.push(preset.configID); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 172 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 173 | } |
| 174 | return categoryIDs; |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * @param {{force: boolean}=} options |
| 179 | * @return {!Promise<string>} |
| 180 | */ |
| 181 | async getInspectedURL(options) { |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 182 | if (options && options.force || !this._inspectedURL) { |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 183 | this._inspectedURL = await this._evaluateInspectedURL(); |
Tim van der Lippe | 1d6e57a | 2019-09-30 11:55:34 +0000 | [diff] [blame] | 184 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 185 | return this._inspectedURL; |
| 186 | } |
| 187 | |
| 188 | recomputePageAuditability() { |
| 189 | const hasActiveServiceWorker = this._hasActiveServiceWorker(); |
| 190 | const hasAtLeastOneCategory = this._hasAtLeastOneCategory(); |
| 191 | const unauditablePageMessage = this._unauditablePageMessage(); |
| 192 | |
| 193 | let helpText = ''; |
| 194 | if (hasActiveServiceWorker) { |
| 195 | helpText = Common.UIString( |
Lorne Mitchell | 7aa2c6c | 2019-04-03 03:50:10 +0000 | [diff] [blame] | 196 | 'Multiple tabs are being controlled by the same service worker. Close your other tabs on the same origin to audit this page.'); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 197 | } else if (!hasAtLeastOneCategory) { |
| 198 | helpText = Common.UIString('At least one category must be selected.'); |
| 199 | } else if (unauditablePageMessage) { |
| 200 | helpText = unauditablePageMessage; |
| 201 | } |
| 202 | |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 203 | this.dispatchEventToListeners(Audits.Events.PageAuditabilityChanged, {helpText}); |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 204 | } |
Paul Lewis | cf2ef22 | 2019-11-22 14:55:35 +0000 | [diff] [blame] | 205 | } |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 206 | |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 207 | /** @type {!Array.<!Audits.Preset>} */ |
Paul Lewis | cf2ef22 | 2019-11-22 14:55:35 +0000 | [diff] [blame] | 208 | export const Presets = [ |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 209 | // configID maps to Lighthouse's Object.keys(config.categories)[0] value |
| 210 | { |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 211 | setting: Common.settings.createSetting('audits.cat_perf', true), |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 212 | configID: 'performance', |
Christy Chen | 38dccb5 | 2019-05-08 22:32:15 +0000 | [diff] [blame] | 213 | title: ls`Performance`, |
| 214 | description: ls`How long does this app take to show content and become usable` |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 215 | }, |
| 216 | { |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 217 | setting: Common.settings.createSetting('audits.cat_pwa', true), |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 218 | configID: 'pwa', |
Christy Chen | 38dccb5 | 2019-05-08 22:32:15 +0000 | [diff] [blame] | 219 | title: ls`Progressive Web App`, |
| 220 | description: ls`Does this page meet the standard of a Progressive Web App` |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 221 | }, |
| 222 | { |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 223 | setting: Common.settings.createSetting('audits.cat_best_practices', true), |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 224 | configID: 'best-practices', |
Christy Chen | 38dccb5 | 2019-05-08 22:32:15 +0000 | [diff] [blame] | 225 | title: ls`Best practices`, |
| 226 | description: ls`Does this page follow best practices for modern web development` |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 227 | }, |
| 228 | { |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 229 | setting: Common.settings.createSetting('audits.cat_a11y', true), |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 230 | configID: 'accessibility', |
Christy Chen | 38dccb5 | 2019-05-08 22:32:15 +0000 | [diff] [blame] | 231 | title: ls`Accessibility`, |
| 232 | description: ls`Is this page usable by people with disabilities or impairments` |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 233 | }, |
| 234 | { |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 235 | setting: Common.settings.createSetting('audits.cat_seo', true), |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 236 | configID: 'seo', |
Christy Chen | 38dccb5 | 2019-05-08 22:32:15 +0000 | [diff] [blame] | 237 | title: ls`SEO`, |
| 238 | description: ls`Is this page optimized for search engine results ranking` |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 239 | }, |
Connor Clark | 3ee5ac7 | 2019-11-07 15:11:58 -0800 | [diff] [blame] | 240 | { |
| 241 | setting: Common.settings.createSetting('audits.cat_pubads', false), |
| 242 | plugin: true, |
| 243 | configID: 'lighthouse-plugin-publisher-ads', |
| 244 | title: ls`Publisher Ads`, |
| 245 | description: ls`Is this page optimized for ad speed and quality` |
| 246 | }, |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 247 | ]; |
| 248 | |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 249 | /** @type {!Array.<!Audits.RuntimeSetting>} */ |
Paul Lewis | cf2ef22 | 2019-11-22 14:55:35 +0000 | [diff] [blame] | 250 | export const RuntimeSettings = [ |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 251 | { |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 252 | setting: Common.settings.createSetting('audits.device_type', 'mobile'), |
Patrick Hulce | 05c18ce | 2018-05-24 00:34:56 +0000 | [diff] [blame] | 253 | description: ls`Apply mobile emulation during auditing`, |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 254 | setFlags: (flags, value) => { |
Paul Irish | d849501 | 2019-07-16 23:51:47 +0000 | [diff] [blame] | 255 | // See Audits.AuditsPanel._setupEmulationAndProtocolConnection() |
Connor Clark | 3f70034 | 2019-07-25 02:10:41 +0000 | [diff] [blame] | 256 | flags.emulatedFormFactor = value; |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 257 | }, |
| 258 | options: [ |
Patrick Hulce | 05c18ce | 2018-05-24 00:34:56 +0000 | [diff] [blame] | 259 | {label: ls`Mobile`, value: 'mobile'}, |
| 260 | {label: ls`Desktop`, value: 'desktop'}, |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 261 | ], |
| 262 | }, |
| 263 | { |
Connor Clark | e66080e | 2019-11-06 16:35:51 -0800 | [diff] [blame] | 264 | // This setting is disabled, but we keep it around to show in the UI. |
| 265 | setting: Common.settings.createSetting('audits.throttling', true), |
| 266 | title: ls`Simulated throttling`, |
| 267 | // We will disable this when we have a Lantern trace viewer within DevTools. |
| 268 | learnMore: |
| 269 | 'https://github.com/GoogleChrome/lighthouse/blob/master/docs/throttling.md#devtools-audits-panel-throttling', |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 270 | setFlags: (flags, value) => { |
Connor Clark | e66080e | 2019-11-06 16:35:51 -0800 | [diff] [blame] | 271 | flags.throttlingMethod = value ? 'simulate' : 'devtools'; |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 272 | }, |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 273 | }, |
| 274 | { |
cjamcl@google.com | aa1532c | 2019-05-31 03:01:24 +0000 | [diff] [blame] | 275 | setting: Common.settings.createSetting('audits.clear_storage', true), |
Patrick Hulce | 05c18ce | 2018-05-24 00:34:56 +0000 | [diff] [blame] | 276 | title: ls`Clear storage`, |
Paul Irish | 8f1e33d | 2018-05-31 02:29:50 +0000 | [diff] [blame] | 277 | description: ls`Reset storage (localStorage, IndexedDB, etc) before auditing. (Good for performance & PWA testing)`, |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 278 | setFlags: (flags, value) => { |
Patrick Hulce | 05c18ce | 2018-05-24 00:34:56 +0000 | [diff] [blame] | 279 | flags.disableStorageReset = !value; |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 280 | }, |
Patrick Hulce | a087f62 | 2018-05-18 00:37:53 +0000 | [diff] [blame] | 281 | }, |
| 282 | ]; |
| 283 | |
Paul Lewis | cf2ef22 | 2019-11-22 14:55:35 +0000 | [diff] [blame] | 284 | export const Events = { |
Trent Apted | ba184a6 | 2018-05-25 02:13:48 +0000 | [diff] [blame] | 285 | PageAuditabilityChanged: Symbol('PageAuditabilityChanged'), |
| 286 | AuditProgressChanged: Symbol('AuditProgressChanged'), |
| 287 | RequestAuditStart: Symbol('RequestAuditStart'), |
| 288 | RequestAuditCancel: Symbol('RequestAuditCancel'), |
Paul Irish | 8f1e33d | 2018-05-31 02:29:50 +0000 | [diff] [blame] | 289 | }; |
Paul Lewis | cf2ef22 | 2019-11-22 14:55:35 +0000 | [diff] [blame] | 290 | |
| 291 | /* Legacy exported object */ |
| 292 | self.Audits = self.Audits || {}; |
| 293 | |
| 294 | /* Legacy exported object */ |
| 295 | Audits = Audits || {}; |
| 296 | |
| 297 | /** |
| 298 | * @constructor |
| 299 | */ |
| 300 | Audits.AuditController = AuditController; |
| 301 | |
| 302 | /** @typedef {{setting: !Common.Setting, configID: string, title: string, description: string}} */ |
| 303 | Audits.Preset; |
| 304 | |
| 305 | Audits.Events = Events; |
| 306 | |
| 307 | /** @typedef {{setting: !Common.Setting, description: string, setFlags: function(!Object, string), options: (!Array|undefined), title: (string|undefined)}} */ |
| 308 | Audits.RuntimeSetting; |
| 309 | |
| 310 | /** @type {!Array.<!Audits.RuntimeSetting>} */ |
| 311 | Audits.RuntimeSettings = RuntimeSettings; |
| 312 | |
| 313 | /** @type {!Array.<!Audits.Preset>} */ |
| 314 | Audits.Presets = Presets; |