annotation nits
This commit is contained in:
Родитель
f757261fce
Коммит
1429a8c7d4
|
@ -3,3 +3,5 @@ chrome-linux/
|
|||
|
||||
node_modules/
|
||||
extension/
|
||||
|
||||
dist
|
||||
|
|
|
@ -34,6 +34,7 @@ class ThemeColor extends Audit {
|
|||
|
||||
static audit(inputs) {
|
||||
const themeColorMeta = inputs.themeColorMeta;
|
||||
// TODO: Verify this is a valid CSS color. Issue #92
|
||||
return ThemeColor.generateAuditResult(!!themeColorMeta, themeColorMeta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,11 @@ class Manifest extends Gather {
|
|||
|
||||
static gather(options) {
|
||||
const driver = options.driver;
|
||||
|
||||
/**
|
||||
* This re-fetches the manifest separately, which could
|
||||
* potentially lead to a different asset. Using the original manifest
|
||||
* resource is tracked in issue #83
|
||||
*/
|
||||
return driver.querySelector('head link[rel="manifest"]')
|
||||
.then(node => node.getAttribute('href'))
|
||||
.then(manifestURL => Manifest._loadFromURL(options, manifestURL))
|
||||
|
|
|
@ -21,8 +21,8 @@ const Gather = require('./gather');
|
|||
class Viewport extends Gather {
|
||||
|
||||
/**
|
||||
* @param {!{driver: !object}} options
|
||||
* @return {!Promise<{viewport: !string}>
|
||||
* @param {!{driver: !Object}} options Run options
|
||||
* @return {!Promise<{viewport: !string}>} The value of the viewport meta's content attribute, or null
|
||||
*/
|
||||
static gather(options) {
|
||||
const driver = options.driver;
|
||||
|
|
|
@ -137,15 +137,15 @@ class ChromeProtocol {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {!string} selector
|
||||
* @return {Promise<Element>}
|
||||
* @param {string} selector Selector to find in the DOM
|
||||
* @return {!Promise<Element>} The found element, or null, resolved in a promise
|
||||
*/
|
||||
querySelector(selector) {
|
||||
return this.sendCommand('DOM.getDocument')
|
||||
.then(result => result.root.nodeId)
|
||||
.then(nodeId => this.sendCommand('DOM.querySelector', {
|
||||
nodeId: nodeId,
|
||||
selector: selector
|
||||
nodeId,
|
||||
selector
|
||||
}))
|
||||
.then(element => {
|
||||
if (element.nodeId === 0) {
|
||||
|
|
|
@ -27,8 +27,8 @@ class Element {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {!string} name
|
||||
* @return {Promise<string>}
|
||||
* @param {!string} name Attribute name
|
||||
* @return {!Promise<string>} The attribute value or null if not found
|
||||
*/
|
||||
getAttribute(name) {
|
||||
return this.driver
|
||||
|
|
Загрузка…
Ссылка в новой задаче