~unity-team/unity-scopes-shell/overview

« back to all changes in this revision

Viewing changes to tests/resultstest.cpp

  • Committer: Michal Hruby
  • Date: 2014-07-31 11:08:50 UTC
  • mfrom: (108.2.4 unity-scopes-shell)
  • Revision ID: michal.mhr@gmail.com-20140731110850-41qkf5s8x8ugm3bj
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
        // get scope proxy
118
118
        m_scope = qobject_cast<scopes_ng::Scope*>(m_scopes->getScope(QString("mock-scope")));
119
119
        QVERIFY(m_scope != nullptr);
 
120
        m_scope->setActive(true);
120
121
 
121
122
        // get scope proxy for TTL scope
122
123
        m_scope_ttl = qobject_cast<scopes_ng::Scope*>(m_scopes->getScope(QString("mock-scope-ttl")));
123
124
        QVERIFY(m_scope != nullptr);
 
125
        m_scope_ttl->setActive(true);
124
126
    }
125
127
 
126
128
    void cleanup()
187
189
        QCOMPARE(headerCustomizations["background"], QVariant("color://black"));
188
190
        QCOMPARE(customizations["shape-images"], QVariant(false));
189
191
 
 
192
        QCOMPARE(m_scope->isActive(), true);
 
193
        m_scope->setActive(false);
190
194
        QCOMPARE(m_scope->isActive(), false);
191
 
        m_scope->setActive(true);
192
 
        QCOMPARE(m_scope->isActive(), true);
193
195
    }
194
196
 
195
197
    void testCategoryQuery()
273
275
        }
274
276
 
275
277
        performSearch(m_scope, QString(""));
276
 
        m_scope->setActive(true);
277
278
 
278
279
        QStringList args;
279
280
        args << "/com/canonical/unity/scopes";
291
292
 
292
293
    void testActiveTtlScope()
293
294
    {
294
 
        m_scope_ttl->setActive(true);
295
295
        performSearch(m_scope_ttl, "query text");
296
296
 
297
297
        // get ResultsModel instance
329
329
 
330
330
    void testInactiveTtlScope()
331
331
    {
332
 
        QSignalSpy dirtySpy(m_scope_ttl, SIGNAL(resultsDirtyChanged()));
333
 
 
334
332
        m_scope_ttl->setActive(false);
335
 
        performSearch(m_scope_ttl, "banana");
336
 
 
337
 
        if (dirtySpy.isEmpty())
338
 
        {
339
 
            QVERIFY(dirtySpy.wait());
340
 
        }
 
333
        m_scope_ttl->setSearchQuery("banana");
341
334
 
342
335
        // Model should go dirty
343
 
        QVERIFY(m_scope_ttl->resultsDirty());
 
336
        QTRY_VERIFY(m_scope_ttl->resultsDirty());
344
337
    }
345
338
 
346
339
    void testAlbumArtResult()