Bug 31088 - Add overridePreference call to all WebGL layout tests
Summary: Add overridePreference call to all WebGL layout tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Kenneth Russell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-03 15:02 PST by Kenneth Russell
Modified: 2009-12-15 14:44 PST (History)
3 users (show)

See Also:


Attachments
Patch (2.57 KB, patch)
2009-11-03 15:08 PST, Kenneth Russell
oliver: review-
Details | Formatted Diff | Diff
Patch (4.50 KB, patch)
2009-11-03 15:40 PST, Kenneth Russell
oliver: review-
Details | Formatted Diff | Diff
Patch (7.69 KB, patch)
2009-11-03 15:51 PST, Kenneth Russell
oliver: review+
oliver: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2009-11-03 15:02:15 PST
The WebGL layout tests all need the call

if (window.layoutTestController)
    layoutTestController.overridePreference("WebKitWebGLEnabled", "1");

as a prologue. This bit is sticky across runs, but an initial run with this bit unset causes the layout tests to fail with the error

"TypeError: Result of expression 'context' [undefined] is not an object."
Comment 1 Kenneth Russell 2009-11-03 15:08:18 PST
Created attachment 42424 [details]
Patch
Comment 2 Oliver Hunt 2009-11-03 15:14:22 PST
Comment on attachment 42424 [details]
Patch

This should just be put in one place, the shader-test.js test prefix
Comment 3 Kenneth Russell 2009-11-03 15:40:07 PST
Created attachment 42430 [details]
Patch

Replacement patch factoring this call into new webgl-test.js for sharing among more tests.
Comment 4 Oliver Hunt 2009-11-03 15:42:06 PST
Comment on attachment 42430 [details]
Patch

There's no reason to use a separate file -- if absolutely necessary rename shader-test.js to webgl-test.js that way each test doesn't end up needing to include multiple files
Comment 5 Kenneth Russell 2009-11-03 15:51:22 PST
Created attachment 42433 [details]
Patch

Patch renaming shader-test.js to webgl-test.js, adding necessary code, and updating references from tests.
Comment 6 Mark Rowe (bdash) 2009-11-03 16:18:22 PST
(In reply to comment #0)
> The WebGL layout tests all need the call
> 
> if (window.layoutTestController)
>     layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
> 
> as a prologue. This bit is sticky across runs, but an initial run with this bit
> unset causes the layout tests to fail with the error
> 
> "TypeError: Result of expression 'context' [undefined] is not an object.”

Can you clarify what you mean by “This bit is sticky across runs”?
Comment 7 Kenneth Russell 2009-11-03 16:22:37 PST
It appears that if a test is run once under DumpRenderTree and the overridePreference is executed, then subsequent runs will work even if the overridePreference call is not in place. In other words, the effect is similar to the "defaults write" command currently used to enable WebGL in WebKit nightly builds.
Comment 8 Mark Rowe (bdash) 2009-11-03 16:27:44 PST
(In reply to comment #7)
> It appears that if a test is run once under DumpRenderTree and the
> overridePreference is executed, then subsequent runs will work even if the
> overridePreference call is not in place. In other words, the effect is similar
> to the "defaults write" command currently used to enable WebGL in WebKit
> nightly builds.

That sounds like a bug in DRT.  It should be resetting preferences to a consistent state between tests, not letting them persist.
Comment 9 Oliver Hunt 2009-11-03 17:26:17 PST
Committed r50492
Comment 10 Kenneth Russell 2009-11-04 10:49:54 PST
(In reply to comment #8)
> (In reply to comment #7)
> > It appears that if a test is run once under DumpRenderTree and the
> > overridePreference is executed, then subsequent runs will work even if the
> > overridePreference call is not in place. In other words, the effect is similar
> > to the "defaults write" command currently used to enable WebGL in WebKit
> > nightly builds.
> 
> That sounds like a bug in DRT.  It should be resetting preferences to a
> consistent state between tests, not letting them persist.

After looking into this a little further, the overridePreference setting isn't sticky across runs, but if ObjC code was ever used to force this preference to true in the context of DumpRenderTree (and it looks like this was done on some of the developers' machines) then it is persistent. I've filed

DumpRenderTree can retain preferences state across runs
https://bugs.webkit.org/show_bug.cgi?id=31129