Bug 31129
Summary: | DumpRenderTree can retain preferences state across runs | ||
---|---|---|---|
Product: | WebKit | Reporter: | Kenneth Russell <kbr> |
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | aroben, cmarrin, jmalonzo, mrowe, oliver, simon.fraser |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.5 | ||
Bug Depends on: | 35905 | ||
Bug Blocks: |
Kenneth Russell
In investigating https://bugs.webkit.org/show_bug.cgi?id=31088 (Add overridePreference call to all WebGL layout tests), the question arose of why the tests were not failing on more machines. After investigation, it looks likely that on the developers' machines and perhaps on the buildbots, a sticky preferences setting was set during one run of the tests, and that setting has been retained for further runs.
Here is how to show that the WebPreferences state that is set up in DumpRenderTree.mm persists across runs:
1. In WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm, resetDefaultsToConsistentValues, add the following at the end of the function:
[preferences setWebGLEnabled:NO];
2. In LayoutTests/fast/canvas/webgl/resources/webgl-test.js, comment out the two lines at the top of the file:
//if (window.layoutTestController)
// layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
3. run-webkit-tests LayoutTests/fast/canvas/webgl/getActiveTest.html . Note that the test fails because the 3D context could not be fetched from the canvas, because WebGL support is not enabled.
4. Change the line in DumpRenderTree.mm to read
[preferences setWebGLEnabled:YES];
5. run-webkit-tests LayoutTests/fast/canvas/webgl/getActiveTest.html . The test passes.
6. Comment out the line in DumpRenderTree.mm
//[preferences setWebGLEnabled:YES];
7. run-webkit-tests LayoutTests/fast/canvas/webgl/getActiveTest.html . The test passes. This is the bug.
It appears that the JavaScript-level call to override the WebKitWebGLEnabled preference does not persist across runs. If it did, that would be a much worse issue. However, it is clear that at least on some machines this preference was set in the context of the DumpRenderTree app once, and that is preventing clean runs of these tests. Plausibly the stickiness comes from the call to [_standardPreferences setAutosaves:YES]; in WebPreferences.mm, standardPreferences.
Not sure what the right fix is; possibly to always initialize [preferences setWebGLEnabled:NO]; in DumpRenderTree.mm.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Adam Roben (:aroben)
One possible way to fix this is to address bug 29751.
Alexey Proskuryakov
> possibly to always initialize [preferences setWebGLEnabled:NO]; in DumpRenderTree.mm.
That seems like a great targeted fix to me. We initialize most preferences, so why not WebGL?
Kenneth Russell
(In reply to comment #2)
> > possibly to always initialize [preferences setWebGLEnabled:NO]; in DumpRenderTree.mm.
>
> That seems like a great targeted fix to me. We initialize most preferences, so why not WebGL?
It looks like this was done in r55857 for https://bugs.webkit.org/show_bug.cgi?id=35905 .
It's possible this bug is no longer relevant.
Alexey Proskuryakov
Let's dupe to bug 29751 then, as this bug's title is now a general one.
*** This bug has been marked as a duplicate of bug 29751 ***