RESOLVED FIXED Bug 80613
[chromium] Clean up culling tests and templatize to test impl constructs
https://bugs.webkit.org/show_bug.cgi?id=80613
Summary [chromium] Clean up culling tests and templatize to test impl constructs
Dana Jansens
Reported 2012-03-08 11:03:20 PST
[chromium] Clean up culling tests and templatize to test impl constructs
Attachments
Patch (218.76 KB, patch)
2012-03-08 11:05 PST, Dana Jansens
no flags
Patch (224.26 KB, patch)
2012-03-08 11:09 PST, Dana Jansens
no flags
Patch (223.88 KB, patch)
2012-03-09 10:14 PST, Dana Jansens
no flags
Patch (220.74 KB, patch)
2012-03-09 13:54 PST, Dana Jansens
no flags
Patch (220.89 KB, patch)
2012-03-10 11:14 PST, Dana Jansens
no flags
Patch (221.39 KB, patch)
2012-03-11 17:16 PDT, Dana Jansens
no flags
Dana Jansens
Comment 1 2012-03-08 11:05:01 PST
Created attachment 130854 [details] Patch This is a large unit test cleanup, plus templatization so that we can run all the CCOcclusionTracker tests with both main and impl thread constructs. While cleaning up, I made the test contain fewer LOC that are not relevant to the particular test, with helper methods in the parent test class. Coverage remains the same.
Dana Jansens
Comment 2 2012-03-08 11:05:41 PST
This is built on top of bug #80173 so EWS should wait for it to land.
Dana Jansens
Comment 3 2012-03-08 11:09:43 PST
Dana Jansens
Comment 4 2012-03-09 10:14:26 PST
Dana Jansens
Comment 5 2012-03-09 10:44:00 PST
Adrienne Walker
Comment 6 2012-03-09 11:01:16 PST
Comment on attachment 131053 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=131053&action=review > Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp:275 > + PassOwnPtr<LayerChromium> create(LayerChromium* parent) > + { > + RefPtr<LayerChromium> layer = LayerChromium::create(); > + return adoptPtr(layer.release().leakRef()); > + } This is super super sketchy. I know that this is "just" test code, but I don't like mixing RefPtr and OwnPtr like this, since the potential for accidentally freeing something with a RefPtr that some OwnPtr is still pointing at seems really huge. And, even if ASAN doesn't get any indigestion from the current code, I don't trust future code to behave properly. Can CCOcclusionTrackerTest typedef LayerPtr and PassLayerPtr to be the right OwnPtr or RefPtr, avoiding this problem? I think this would also allow you to merge some functions and m_layerChromium/m_layerImpl. > Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp:317 > + CCProxy::setCurrentThreadIsImplThread(true); \ I think you can use DebugScopedSetImplThread instead of calling setCurrentThreadIsImplThread anywhere in this patch.
Dana Jansens
Comment 7 2012-03-09 13:53:47 PST
(In reply to comment #6) > (From update of attachment 131053 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=131053&action=review > > > Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp:275 > > + PassOwnPtr<LayerChromium> create(LayerChromium* parent) > > + { > > + RefPtr<LayerChromium> layer = LayerChromium::create(); > > + return adoptPtr(layer.release().leakRef()); > > + } > > This is super super sketchy. I know that this is "just" test code, but I don't like mixing RefPtr and OwnPtr like this, since the potential for accidentally freeing something with a RefPtr that some OwnPtr is still pointing at seems really huge. And, even if ASAN doesn't get any indigestion from the current code, I don't trust future code to behave properly. > > Can CCOcclusionTrackerTest typedef LayerPtr and PassLayerPtr to be the right OwnPtr or RefPtr, avoiding this problem? I think this would also allow you to merge some functions and m_layerChromium/m_layerImpl. Thanks for the brilliant idea to dump all the types into two classes and make the template on them. That really helped make this possible. Got rid of all the leakPtr weirdness. > > Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp:317 > > + CCProxy::setCurrentThreadIsImplThread(true); \ > > I think you can use DebugScopedSetImplThread instead of calling setCurrentThreadIsImplThread anywhere in this patch. Done! Thanks for pointing it out.
Dana Jansens
Comment 8 2012-03-09 13:54:30 PST
Dana Jansens
Comment 9 2012-03-09 13:55:56 PST
go/pastebin/2123005
Adrienne Walker
Comment 10 2012-03-09 14:19:53 PST
Comment on attachment 131100 [details] Patch Looks way better. Thanks! R=me
WebKit Review Bot
Comment 11 2012-03-09 17:24:24 PST
Comment on attachment 131100 [details] Patch Clearing flags on attachment: 131100 Committed r110353: <http://trac.webkit.org/changeset/110353>
WebKit Review Bot
Comment 12 2012-03-09 17:24:29 PST
All reviewed patches have been landed. Closing bug.
Dana Jansens
Comment 13 2012-03-10 10:36:32 PST
Reopening to fix compile on other platforms.
Dana Jansens
Comment 14 2012-03-10 11:14:59 PST
Created attachment 131179 [details] Patch Fix build on mac. Missing this-> on calcDrawEtc() calls.
WebKit Review Bot
Comment 15 2012-03-10 18:37:54 PST
Comment on attachment 131179 [details] Patch Clearing flags on attachment: 131179 Committed r110384: <http://trac.webkit.org/changeset/110384>
WebKit Review Bot
Comment 16 2012-03-10 18:38:00 PST
All reviewed patches have been landed. Closing bug.
Dana Jansens
Comment 17 2012-03-11 15:55:23 PDT
Reopening to fix win build!
Dana Jansens
Comment 18 2012-03-11 17:16:08 PDT
Created attachment 131261 [details] Patch Fix build on win. Missing a default constructor in each of the test classes. Ran a win & mac try job.
WebKit Review Bot
Comment 19 2012-03-12 08:50:44 PDT
Comment on attachment 131261 [details] Patch Clearing flags on attachment: 131261 Committed r110433: <http://trac.webkit.org/changeset/110433>
WebKit Review Bot
Comment 20 2012-03-12 08:50:59 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.