Audit.run("foo") doesn't run task named "foo" |
||
Issue description
Consider this:
audit = Audit.createTaskRunner();
audit.define("foo", ...);
audit.run("foo");
audit complains:
audit.js:64 Uncaught Error: Audit.run:: undefined task.
There's a logic error in run:
for (let i = 0; arguments.length; i++) {
let taskLabel = arguments[i];
if (!this._tasks.hasOwnProperty(taskLabel)) {
_throwException('Audit.run:: undefined task.');
} else if (this._taskSequence.includes(taskLabel)) {
_throwException('Audit.run:: duplicate task request.');
} else {
this._taskSequence.push[taskLabel];
}
}
In the first if, hasOwnProperty is true for this, but we don't do anything with it. It should push taskLabel to taskSequence.
,
Dec 7 2016
Pushing is using [] instead of (). My fault.
,
Dec 8 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f0426811873244e80feac8e0de79e1eb0633cb21 commit f0426811873244e80feac8e0de79e1eb0633cb21 Author: hongchan <hongchan@chromium.org> Date: Thu Dec 08 20:04:11 2016 Fixing audit.js: should().beCloseTo() and task.run('taskName') This CL fixes two trivial bugs in audit.js: The issue 672203 : task.run('taskName') The issue 672191 : should().beCloseTo() BUG= 672203 , 672191 Review-Url: https://codereview.chromium.org/2561573006 Cr-Commit-Position: refs/heads/master@{#437312} [modify] https://crrev.com/f0426811873244e80feac8e0de79e1eb0633cb21/third_party/WebKit/LayoutTests/webaudio/resources/audit.js [modify] https://crrev.com/f0426811873244e80feac8e0de79e1eb0633cb21/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html
,
Dec 8 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by hongchan@chromium.org
, Dec 7 2016