~smspillaz/compiz-core/compiz-core.fix_931958

« back to all changes in this revision

Viewing changes to include/core/window.h

There's a lot of refactoring that makes it possible to get PrivateScreen under test. The inital purpose was to get "updatePlugins" under test.

To do this it was necessary to start disentagling the CompScreen interface used by much of the code from the implementation - the result is a CompScreenImpl object that has the actual functionality.

Significantly, it is now possible to mock CompScreen - and a couple of tests for PrivateScreen::updatePlugins are added.

These tests highlight a number of issues with initialisation and cleanup which will be addressed later. But it's probably good to make the refactoring work available for comment sooner rather than later.

I realise that these tests are far from "unit tests" but the interface to PrivateScreen is messy, involving globals, and dependencies on public state. (And at least they don't hit the filesystem.)

Merged from lp:~alan-griffiths/compiz-core/test-PrivateScreen-updatePlugins

Show diffs side-by-side

added added

removed removed

Lines of Context:
539
539
        WRAPABLE_HND (19, WindowInterface, bool, focused);
540
540
 
541
541
        friend class PrivateWindow;
542
 
        friend class CompScreen;
 
542
        friend class CompScreenImpl;
543
543
        friend class PrivateScreen;
544
544
        friend class ModifierHandler;
545
545
        friend class CoreWindow;