aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2017-08-03 15:25:28 +0300
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2017-08-04 15:51:05 +0000
commit251ba40de4f40bdb39d1260e5045d1517126c89b (patch)
treea3aa9e2f73759fface8c9cbb7cba3cc4f02cd5a5 /tests/auto
parentb431f478bce41c22541e27da588256b029c36838 (diff)
tests: Allow input sequence to be in any case format
Currently the text input sequence for the automatic test was expected to be in lowercase. This change modifies this behavior and allows the input sequence to be in any case format. Change-Id: Ic8230d586a290ab481bf1183a204d10a4b37fa7d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/inputpanel/data/inputpanel/inputpanel.qml11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
index 1113a268..685cc6c7 100644
--- a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
+++ b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml
@@ -289,14 +289,21 @@ InputPanel {
return Utils.findChild(keyboardLayoutLoader, key, function(obj, param) {
if (!obj.hasOwnProperty("key") || !obj.hasOwnProperty("text"))
return false
- return (typeof param == "number") ? obj.key === param : obj.text === param
+ return (typeof param == "number") ? obj.key === param : obj.text.toUpperCase() === param.toUpperCase()
})
}
function findVirtualKeyAlternative(key) {
if (typeof key != "string")
return null
- return Utils.findChildByProperty(keyboardLayoutLoader, "effectiveAlternativeKeys", key, function(propertyValue, key) { return propertyValue.indexOf(key) !== -1 })
+ return Utils.findChildByProperty(keyboardLayoutLoader, "effectiveAlternativeKeys", key.toUpperCase(),
+ function(propertyValue, key) {
+ if (typeof propertyValue == "string")
+ return propertyValue.toUpperCase().indexOf(key) !== -1
+ return propertyValue.filter(function(value) {
+ return key === value.toUpperCase()
+ }).length > 0
+ })
}
function findObjectByName(objectName) {