2
* Copyright 2016 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by Jonas G. Drange <jonas.drange@canonical.com>
21
import Ubuntu.Components 1.3
22
import Ubuntu.Settings.Fingerprint 0.1
23
import Ubuntu.Test 0.1
36
id: fingerprintVisualComp
40
objectName: "fingerprintVisual"
48
name: "FingerprintVisual"
52
visualReadySpy.target = fingerprintVisualComp.createObject(testRoot);
57
findChild(testRoot, "fingerprintVisual").destroy();
60
function test_masks_data() {
62
{ masks: null, targetMasks: [], tag: "null" },
63
{ masks: [], targetMasks: [], tag: "no masks" },
65
masks: [{x: 0, y: 0, width: 0, height: 0 }],
66
targetMasks: [{x: 0, y: 0, width: 0, height: 0}],
71
{x: null, y: "-a", width: "0x1", height: true },
78
// Masks for manual, visual checks.
81
{x: 0, y: 0, width: 0.5, height: 0.5 }
84
tag: "top right corner"
88
{x: 0.5, y: 0, width: 0.5, height: 0.5 }
91
tag: "top left corner"
95
{x: 0, y: 0.5, width: 0.5, height: 0.5 }
98
tag: "bottom right corner"
102
{x: 0.5, y: 0.5, width: 0.5, height: 0.5 }
105
tag: "bottom left corner"
109
{x: 0, y: 0, width: 0.5, height: 0.5 },
110
{x: 0.5, y: 0, width: 0.5, height: 0.5 },
111
{x: 0, y: 0.5, width: 0.5, height: 0.5 },
112
{x: 0.5, y: 0.5, width: 0.5, height: 0.5 }
120
function test_masks (data) {
121
var vis = findChild(testRoot, "fingerprintVisual");
122
vis.masks = data.masks;
123
if (data.visualCheck) {
126
var actualMasks = vis.getMasksToEnroll();
127
var targetMasks = data.targetMasks;
128
compare(actualMasks.length, targetMasks.length);