[autotests] Make lifespan of EffectsHandler outlive Effect
ClosedPublic

Authored by davidedmundson on Aug 30 2018, 11:48 AM.

Details

Summary

Effects are deleted in a deleteLater potentially outside the scope of
our test. Our MockEffectsHandler (which contains the global static
"effects") has the lifespan of the test.

Fixes failing unit test.

Test Plan

Ran test

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: KWin. · View Herald TranscriptAug 30 2018, 11:48 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Aug 30 2018, 11:48 AM
zzag added a subscriber: zzag.EditedAug 30 2018, 11:59 AM

Oh, you already uploaded fix.

Please also change TestScriptedEffectLoader and TestPluginEffectLoader.

Also, maybe we have to reset effects ptr in destructor of EffectsHandler.

zzag added a comment.Aug 30 2018, 12:06 PM

Also, I think it would be better to be uniform and create dynamic mock EffectsHandler's in all tests.

zzag accepted this revision.EditedAug 30 2018, 12:49 PM

Also, I think it would be better to be uniform and create dynamic mock EffectsHandler's in all tests.

Please ignore it (and "TestScriptedEffectLoader and TestPluginEffectLoader" part).


But, I still think it would be a good idea to reset effects in destructor of EffectsHandler.

This revision is now accepted and ready to land.Aug 30 2018, 12:49 PM

Updated all tests where an effect->deleteLater() is used

This revision was automatically updated to reflect the committed changes.