~unity-team/unity-scopes-shell/catch-no-search-hint

« back to all changes in this revision

Viewing changes to tests/resultstest.cpp

  • Committer: Michal Hruby
  • Date: 2014-07-31 11:01:21 UTC
  • mfrom: (110.1.2 unity-scopes-shell)
  • Revision ID: michal.mhr@gmail.com-20140731110121-1jypks8l5plrus91
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()
282
284
        }
283
285
 
284
286
        performSearch(m_scope, QString(""));
285
 
        m_scope->setActive(true);
286
287
 
287
288
        QStringList args;
288
289
        args << "/com/canonical/unity/scopes";
300
301
 
301
302
    void testActiveTtlScope()
302
303
    {
303
 
        m_scope_ttl->setActive(true);
304
304
        performSearch(m_scope_ttl, "query text");
305
305
 
306
306
        // get ResultsModel instance
338
338
 
339
339
    void testInactiveTtlScope()
340
340
    {
341
 
        QSignalSpy dirtySpy(m_scope_ttl, SIGNAL(resultsDirtyChanged()));
342
 
 
343
341
        m_scope_ttl->setActive(false);
344
 
        performSearch(m_scope_ttl, "banana");
345
 
 
346
 
        if (dirtySpy.isEmpty())
347
 
        {
348
 
            QVERIFY(dirtySpy.wait());
349
 
        }
 
342
        m_scope_ttl->setSearchQuery("banana");
350
343
 
351
344
        // Model should go dirty
352
 
        QVERIFY(m_scope_ttl->resultsDirty());
 
345
        QTRY_VERIFY(m_scope_ttl->resultsDirty());
353
346
    }
354
347
 
355
348
    void testAlbumArtResult()