[Webkit-unassigned] [Bug 32596] New: Refactor Window object tests to use a shared list of property names

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 15 22:31:10 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=32596

           Summary: Refactor Window object tests to use a shared list of
                    property names
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Tools / Tests
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: kent.hansen at nokia.com
                CC: hausmann at webkit.org
            Blocks: 28771


Some of the LayoutTests use for-in statements on the Window object to create a
list of property names to use for testing. This approach is not very robust.
The issues can be summed up as follows:

1) Adding new properties on the Window object breaks existing tests.

It's especially unfortunate when commits like r51997 are necessary just to keep
existing tests working. If the test inputs were decoupled from the Window
object itself, such situations would be avoided. (The script for
LayoutTests/fast/dom/wrapper-identity, a test that _does_ use an a priori list
of property names, begins with the comment "We use a static list of window
properties to avoid breaking when new properties are added.")

2) The for-in statement only reports enumerable properties.

The Window object has several non-enumerable properties that are relevant for
testing; it's a shame that these are excluded. On a related note, it's not
possible to make an existing enumerable property non-enumerable without
breaking tests (this is a blocker for
https://bugs.webkit.org/show_bug.cgi?id=28771).

3) The for-in statement dredges up properties from the prototype chain.

In order to ensure that only properties on the Window object itself are tested,
the loop body should therefore call window.hasOwnProperty(). But none of the
tests perform this check, which means that they can erroneously process
inherited (i.e. irrelevant) properties. (The tests for the "inner.isInner"
property in LayoutTests/fast/dom/prototype-inheritance-expected.txt is the only
place I've found that demonstrates this problem.)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list