~faenil/ubuntu-ui-toolkit/UbuntuTestCase_flick_flakiness_fix

« back to all changes in this revision

Viewing changes to tests/unit/tst_i18n/tst_i18n_RelativeTime/src/tst_i18n_RelativeTime.cpp

  • Committer: Andrea Bernabei
  • Date: 2016-02-09 21:30:24 UTC
  • mfrom: (1795.2.47 staging)
  • Revision ID: andrea.bernabei@canonical.com-20160209213024-txzjng3d5bewlu1l
merge staging

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
#include "ucunits.h"
41
41
#include "i18n.h"
 
42
#include "plugin.h"
42
43
 
43
44
class tst_I18n_RelativeTime : public QObject
44
45
{
88
89
 
89
90
        view = new QQuickView;
90
91
        QQmlEngine *quickEngine = view->engine();
 
92
        UbuntuComponentsPlugin::initializeContextProperties(quickEngine);
91
93
 
92
 
        view->setGeometry(0,0, UCUnits::instance().gu(40), UCUnits::instance().gu(30));
 
94
        view->setGeometry(0,0, UCUnits::instance()->gu(40), UCUnits::instance()->gu(30));
93
95
        //add modules folder so we have access to the plugin from QML
94
96
        QStringList imports = quickEngine->importPathList();
95
97
        imports.prepend(QDir(modules).absolutePath());
103
105
 
104
106
    void testCase_RelativeTime()
105
107
    {
106
 
        UbuntuI18n* i18n = &UbuntuI18n::instance();
 
108
        QQmlEngine engine;
 
109
        UbuntuComponentsPlugin::initializeContextProperties(&engine);
 
110
        UbuntuI18n* i18n = UbuntuI18n::instance();
107
111
        // By default no domain is set
108
112
        QCOMPARE(i18n->domain(), QString(""));
109
113