on xenial help sign in
s/valid/available
a3d02abMichael Terry
qml/Greeter/Greeter.qml+1−1
@@ -488,7 +488,7 @@ Showable {
488
488
489 property var operation: null
489 property var operation: null
490 readonly property bool idEnabled: root.active &&
490 readonly property bool idEnabled: root.active &&
491− Biometryd.valid &&
491+ Biometryd.available &&
492 AccountsService.enableFingerprintIdentification
492 AccountsService.enableFingerprintIdentification
493
493
494 function cancelOperation() {
494 function cancelOperation() {
tests/mocks/Biometryd/MockBiometryd.cpp+7−7
@@ -20,7 +20,7 @@
20MockBiometryd::MockBiometryd(QObject *parent)
20MockBiometryd::MockBiometryd(QObject *parent)
21 : QObject(parent)
21 : QObject(parent)
22 , m_device(new MockDevice(this))
22 , m_device(new MockDevice(this))
23− , m_valid(false)
23+ , m_available(false)
24{
24{
25}
25}
26
26
@@ -29,15 +29,15 @@ MockDevice *MockBiometryd::defaultDevice() const
29 return m_device;
29 return m_device;
30}
30}
31
31
32−bool MockBiometryd::valid() const
32+bool MockBiometryd::available() const
33{
33{
34− return m_valid;
34+ return m_available;
35}
35}
36
36
37−void MockBiometryd::setValid(bool valid)
37+void MockBiometryd::setAvailable(bool available)
38{
38{
39− if (m_valid != valid) {
39+ if (m_available != available) {
40− m_valid = valid;
40+ m_available = available;
41− Q_EMIT validChanged();
41+ Q_EMIT availableChanged();
42 }
42 }
43}
43}
tests/mocks/Biometryd/MockBiometryd.h+8−8
@@ -26,25 +26,25 @@ class MockBiometryd : public QObject
26 Q_OBJECT
26 Q_OBJECT
27 Q_DISABLE_COPY(MockBiometryd)
27 Q_DISABLE_COPY(MockBiometryd)
28 Q_PROPERTY(MockDevice *defaultDevice READ defaultDevice CONSTANT)
28 Q_PROPERTY(MockDevice *defaultDevice READ defaultDevice CONSTANT)
29− Q_PROPERTY(bool valid
29+ Q_PROPERTY(bool available
30− READ valid
30+ READ available
31− WRITE setValid // only in mock
31+ WRITE setAvailable // only in mock
32− NOTIFY validChanged)
32+ NOTIFY availableChanged)
33
33
34public:
34public:
35 explicit MockBiometryd(QObject *parent = 0);
35 explicit MockBiometryd(QObject *parent = 0);
36
36
37 MockDevice *defaultDevice() const;
37 MockDevice *defaultDevice() const;
38
38
39− bool valid() const;
39+ bool available() const;
40− void setValid(bool valid);
40+ void setAvailable(bool available);
41
41
42Q_SIGNALS:
42Q_SIGNALS:
43− void validChanged();
43+ void availableChanged();
44
44
45private:
45private:
46 MockDevice *m_device;
46 MockDevice *m_device;
47− bool m_valid;
47+ bool m_available;
48};
48};
49
49
50#endif // MOCK_BIOMETRYD_H
50#endif // MOCK_BIOMETRYD_H
tests/qmltests/Greeter/tst_Greeter.qml+11−11
@@ -150,7 +150,7 @@ Item {
150 teaseSpy.clear();
150 teaseSpy.clear();
151 sessionStartedSpy.clear();
151 sessionStartedSpy.clear();
152 activeChangedSpy.clear();
152 activeChangedSpy.clear();
153− Biometryd.valid = false;
153+ Biometryd.available = false;
154 AccountsService.enableFingerprintIdentification = false;
154 AccountsService.enableFingerprintIdentification = false;
155 viewShowMessageSpy.clear();
155 viewShowMessageSpy.clear();
156 viewShowPromptSpy.clear();
156 viewShowPromptSpy.clear();
@@ -565,7 +565,7 @@ Item {
565 }
565 }
566
566
567 function test_fingerprintSuccess() {
567 function test_fingerprintSuccess() {
568− Biometryd.valid = true;
568+ Biometryd.available = true;
569 AccountsService.enableFingerprintIdentification = true;
569 AccountsService.enableFingerprintIdentification = true;
570 var index = selectUser("has-password");
570 var index = selectUser("has-password");
571
571
@@ -578,7 +578,7 @@ Item {
578 }
578 }
579
579
580 function test_fingerprintFailureMessage() {
580 function test_fingerprintFailureMessage() {
581− Biometryd.valid = true;
581+ Biometryd.available = true;
582 AccountsService.enableFingerprintIdentification = true;
582 AccountsService.enableFingerprintIdentification = true;
583 var index = selectUser("has-password");
583 var index = selectUser("has-password");
584
584
@@ -592,7 +592,7 @@ Item {
592 }
592 }
593
593
594 function test_fingerprintTooManyFailures() {
594 function test_fingerprintTooManyFailures() {
595− Biometryd.valid = true;
595+ Biometryd.available = true;
596 AccountsService.enableFingerprintIdentification = true;
596 AccountsService.enableFingerprintIdentification = true;
597 selectUser("has-password");
597 selectUser("has-password");
598
598
@@ -608,7 +608,7 @@ Item {
608 }
608 }
609
609
610 function test_fingerprintFailureCountReset() {
610 function test_fingerprintFailureCountReset() {
611− Biometryd.valid = true;
611+ Biometryd.available = true;
612 AccountsService.enableFingerprintIdentification = true;
612 AccountsService.enableFingerprintIdentification = true;
613 selectUser("has-password");
613 selectUser("has-password");
614
614
@@ -629,7 +629,7 @@ Item {
629 }
629 }
630
630
631 function test_fingerprintWrongUid() {
631 function test_fingerprintWrongUid() {
632− Biometryd.valid = true;
632+ Biometryd.available = true;
633 AccountsService.enableFingerprintIdentification = true;
633 AccountsService.enableFingerprintIdentification = true;
634 selectUser("has-password");
634 selectUser("has-password");
635
635
@@ -642,7 +642,7 @@ Item {
642 }
642 }
643
643
644 function test_fingerprintNotEnabled() {
644 function test_fingerprintNotEnabled() {
645− Biometryd.valid = true;
645+ Biometryd.available = true;
646 selectUser("has-password");
646 selectUser("has-password");
647
647
648 var biometryd = findInvisibleChild(greeter, "biometryd");
648 var biometryd = findInvisibleChild(greeter, "biometryd");
@@ -660,21 +660,21 @@ Item {
660 AccountsService.enableFingerprintIdentification = true;
660 AccountsService.enableFingerprintIdentification = true;
661 selectUser("has-password");
661 selectUser("has-password");
662
662
663− verify(!Biometryd.valid);
663+ verify(!Biometryd.available);
664
664
665 var biometryd = findInvisibleChild(greeter, "biometryd");
665 var biometryd = findInvisibleChild(greeter, "biometryd");
666 verify(!biometryd.operation);
666 verify(!biometryd.operation);
667
667
668− Biometryd.valid = true;
668+ Biometryd.available = true;
669 verify(biometryd.operation);
669 verify(biometryd.operation);
670 verify(biometryd.operation.running);
670 verify(biometryd.operation.running);
671
671
672− Biometryd.valid = false;
672+ Biometryd.available = false;
673 verify(!biometryd.operation);
673 verify(!biometryd.operation);
674 }
674 }
675
675
676 function test_fingerprintGreeterNotActive() {
676 function test_fingerprintGreeterNotActive() {
677− Biometryd.valid = true;
677+ Biometryd.available = true;
678 AccountsService.enableFingerprintIdentification = true;
678 AccountsService.enableFingerprintIdentification = true;
679 selectUser("has-password");
679 selectUser("has-password");
680
680