New issue
Advanced search Search tips

Issue 672203 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Dec 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 672152



Sign in to add a comment

Audit.run("foo") doesn't run task named "foo"

Project Member Reported by rtoy@chromium.org, Dec 7 2016

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.

 
Ha, that wasn't the bug. See the second condition of |for| expression.
Pushing is using [] instead of (). My fault.
Project Member

Comment 3 by bugdroid1@chromium.org, 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

Status: Verified (was: Assigned)

Sign in to add a comment