~sil2100/compiz/quickfix_1141079_raring

« back to all changes in this revision

Viewing changes to compizconfig/mocks/libcompizconfig/compizconfig_ccs_context_mock.h

  • Committer: Tarmac
  • Author(s): Sam Spilsbury, Brandon Schaefer
  • Date: 2013-02-22 05:32:31 UTC
  • mfrom: (3617.1.15 compiz.fix_1130679)
  • Revision ID: tarmac-20130222053231-dlp3151si62x4dw9
Fix startup issues

Amalgamated changes:

0. Re-set the setting parents correctly after an upgrade
1. Move the backend loading and config file handling code into separate objects, we need to inject them by interface in order to isolate CCSContextDefaultImpl for testing
2. Add the ccp plugin to "initialPlugins" rather than setting the option directly, that never worked.
3. Added some framework to force-import any profile available in the system config dirs and not reported as existing by the backing. This is so that we have a guaruntee that we will get its values
4. Bail out correctly when a schema couldn't be found

(LP: #1130679). Fixes: https://bugs.launchpad.net/bugs/1130679.

Approved by Brandon Schaefer, PS Jenkins bot, Łukasz Zemczak.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _COMPIZCONFIG_CCS_CONTEXT_MOCK_H
 
2
#define _COMPIZCONFIG_CCS_CONTEXT_MOCK_H
 
3
 
1
4
#include <gtest/gtest.h>
2
5
#include <gmock/gmock.h>
3
6
 
29
32
        virtual const char * getBackend () = 0;
30
33
        virtual Bool setBackend (char *name) = 0;
31
34
        virtual void setIntegrationEnabled (Bool value) = 0;
32
 
        virtual void setProfile (char *name) = 0;
 
35
        virtual void setProfile (const char *name) = 0;
33
36
        virtual void setPluginListAutoSort (Bool value) = 0;
34
37
        virtual const char * getProfile () = 0;
35
38
        virtual Bool getIntegrationEnabled () = 0;
77
80
        MOCK_METHOD0 (getBackend, const char * ());
78
81
        MOCK_METHOD1 (setBackend, Bool (char *));
79
82
        MOCK_METHOD1 (setIntegrationEnabled, void (Bool));
80
 
        MOCK_METHOD1 (setProfile, void (char *));
 
83
        MOCK_METHOD1 (setProfile, void (const char *));
81
84
        MOCK_METHOD1 (setPluginListAutoSort, void (Bool));
82
85
        MOCK_METHOD0 (getProfile, const char * ());
83
86
        MOCK_METHOD0 (getIntegrationEnabled, Bool ());
232
235
        }
233
236
 
234
237
        static void
235
 
        ccsSetProfile (CCSContext *context, char *name)
 
238
        ccsSetProfile (CCSContext *context, const char *name)
236
239
        {
237
240
            ((CCSContextGMock *) ccsObjectGetPrivate (context))->setProfile (name);
238
241
        }
356
359
};
357
360
 
358
361
extern CCSContextInterface CCSContextGMockInterface;
 
362
 
 
363
#endif