~ci-train-bot/unity8/unity8-ubuntu-zesty-2404

« back to all changes in this revision

Viewing changes to tests/utils/modules/Unity/Test/UnityTestCase.qml

  • Committer: Daniel d'Andrada
  • Date: 2016-04-04 13:37:49 UTC
  • mto: (2328.1.1 horizVertWindowMaximize)
  • mto: This revision was merged to the branch mainline in revision 2336.
  • Revision ID: daniel.dandrada@canonical.com-20160404133749-cktz4197aos6ovdy
Surface-based window management

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright 2013-2015 Canonical Ltd.
 
2
 * Copyright 2013-2016 Canonical Ltd.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU General Public License as published by
16
16
 
17
17
import QtQuick 2.4
18
18
import QtTest 1.0
 
19
import Unity.Application 0.1
19
20
import Ubuntu.Components 1.3
20
21
import Unity.Test 0.1 as UT
 
22
import Utils 0.1
21
23
 
22
24
TestCase {
23
25
    id: testCase
24
 
    TestUtil {id:util}
 
26
    property var util: TestUtil {id:util}
25
27
 
26
28
    // This is needed for waitForRendering calls to return
27
29
    // if the watched element already got rendered
538
540
            tryCompare(transition, "running", false, 2000);
539
541
        }
540
542
    }
 
543
 
 
544
    /*
 
545
         kill all (fake) running apps but unity8-dash, bringing Unity.Application back to its initial state
 
546
     */
 
547
    function killApps() {
 
548
        while (ApplicationManager.count > 1) {
 
549
            var appIndex = ApplicationManager.get(0).appId == "unity8-dash" ? 1 : 0
 
550
            var application = ApplicationManager.get(appIndex);
 
551
            ApplicationManager.stopApplication(application.appId);
 
552
            // wait until all zombie surfaces are gone. As MirSurfaceItems hold references over them.
 
553
            // They won't be gone until those surface items are destroyed.
 
554
            tryCompareFunction(function() { return application.surfaceList.count }, 0);
 
555
            tryCompare(application, "state", ApplicationInfo.Stopped);
 
556
        }
 
557
        compare(ApplicationManager.count, 1);
 
558
    }
541
559
}