~lukas-kde/unity8/dashboard

« back to all changes in this revision

Viewing changes to tests/qmltests/tst_ShellWithPin.qml

  • Committer: Lukáš Tinkl
  • Date: 2017-01-26 12:13:17 UTC
  • mfrom: (2749.1.49 unity8)
  • Revision ID: lukas.tinkl@canonical.com-20170126121317-qms39s9pikclidbe
merge trunk, fix conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import QtTest 1.0
20
20
import AccountsService 0.1
21
21
import GSettings 1.0
22
 
import LightDM.IntegratedLightDM 0.1 as LightDM
 
22
import LightDMController 0.1
 
23
import LightDM.FullLightDM 0.1 as LightDM
23
24
import Ubuntu.SystemImage 0.1
24
25
import Ubuntu.Telephony 0.1 as Telephony
25
26
import Unity.Application 0.1
35
36
 
36
37
    Component.onCompleted: {
37
38
        // must set the mock mode before loading the Shell
38
 
        LightDM.Greeter.mockMode = "single-pin";
39
 
        LightDM.Users.mockMode = "single-pin";
 
39
        LightDMController.userMode = "single-pin";
40
40
        shellLoader.active = true;
41
41
    }
42
42
 
117
117
        signalName: "resettingDevice"
118
118
    }
119
119
 
120
 
    SignalSpy {
121
 
        id: promptSpy
122
 
        target: LightDM.Greeter
123
 
        signalName: "showPrompt"
124
 
    }
125
 
 
126
120
    Telephony.CallEntry {
127
121
        id: phoneCall
128
122
        phoneNumber: "+447812221111"
539
533
            shellLoader.itemDestroyed = false;
540
534
            shellLoader.active = false;
541
535
            tryCompare(shellLoader, "itemDestroyed", true);
542
 
            LightDM.Greeter.authenticate(""); // reset greeter
543
536
 
544
537
            // Create new shell
545
 
            promptSpy.clear();
546
538
            shellLoader.active = true;
547
539
            tryCompareFunction(function() {return shell !== null}, true);
548
540
 
549
541
            // Confirm that we start disabled
550
 
            compare(promptSpy.count, 0);
 
542
            compare(LightDM.Prompts.count, 0);
551
543
            verify(shell.waitingOnGreeter);
552
544
            var coverPageDragHandle = findChild(shell, "coverPageDragHandle");
553
545
            verify(!coverPageDragHandle.enabled);
554
546
 
555
547
            // And that we only become enabled once the lockscreen is up
556
548
            tryCompare(shell, "waitingOnGreeter", false);
557
 
            verify(promptSpy.count > 0);
 
549
            verify(LightDM.Prompts.count > 0);
558
550
            var lockscreen = findChild(shell, "lockscreen");
559
551
            verify(lockscreen.shown);
560
552
        }
 
553
 
 
554
        function test_bfbOnLockedDevice() {
 
555
            var launcher = findChild(shell, "launcher");
 
556
            touchFlick(shell, units.gu(.5), shell.height / 2, units.gu(10), shell.height / 2);
 
557
 
 
558
            tryCompare(launcher, "x", 0);
 
559
            tryCompare(launcher, "state", "visible");
 
560
 
 
561
            waitForRendering(shell)
 
562
 
 
563
            var bfb = findChild(launcher, "buttonShowDashHome");
 
564
            mouseClick(bfb, bfb.width / 2, bfb.height / 2);
 
565
 
 
566
            enterPin("1234")
 
567
 
 
568
            tryCompare(launcher, "state", "drawer");
 
569
        }
561
570
    }
562
571
}