Skip to content

GPII-779: Add support in Android for detecting installed solutions #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions gpii/node_modules/testing/src/Integration.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

136 changes: 79 additions & 57 deletions testData/solutions/android.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "FreeSpeech",
"contexts": {
"OS": [{
"id": "android",
"version": ">=0.1"
}]
"id": "android",
"version": ">=0.1"
}]
},
"settingsHandlers": {
"configuration": {
Expand All @@ -17,20 +17,22 @@
]
}
},
"start": [
{
"type": "gpii.androidActivityManager.startFreespeech"
}
]
"start": [{
"type": "gpii.androidActivityManager.startFreespeech"
}],
"isInstalled": [{
"type": "gpii.androidDeviceReporter.findService",
"name": "com.blogspot.tonyatkins.freespeech"
}]
},

"com.android.talkback": {
"name": "TalkBack Screen Reader",
"contexts": {
"OS": [{
"id": "android",
"version": ">=0.1"
}]
"id": "android",
"version": ">=0.1"
}]
},
"settingsHandlers": {
"configuration": {
Expand All @@ -52,18 +54,20 @@
{
"type": "gpii.androidActivityManager.stopTalkback"
}
]
],
"isInstalled": [{
"type": "gpii.androidDeviceReporter.findService",
"name": "com.google.android.marvin.talkback"
}]
},

"com.android.persistentConfiguration": {
"name": "Android Configuration",
"contexts": {
"OS": [
{
"id": "android",
"version": ">=0.1"
}
]
"OS": [{
"id": "android",
"version": ">=0.1"
}]
},
"settingsHandlers": {
"configuration": {
Expand Down Expand Up @@ -267,18 +271,20 @@
],
"restore": [
"settings.configuration"
]
],
"isInstalled": [{
"type": "gpii.androidDeviceReporter.findService",
"name": "android"
}]
},

"com.android.audioManager": {
"name": "Android Audio Manager",
"contexts": {
"OS": [
{
"id": "android",
"version": ">=0.1"
}
]
"OS": [{
"id": "android",
"version": ">=0.1"
}]
},
"settingsHandlers": {
"configuration": {
Expand Down Expand Up @@ -319,18 +325,20 @@
],
"restore": [
"settings.configuration"
]
],
"isInstalled": [{
"type": "gpii.androidDeviceReporter.findService",
"name": "com.android.providers.media"
}]
},

"com.android.settings.system": {
"name": "Android UI Settings.System",
"contexts": {
"OS": [
{
"id": "android",
"version": ">=0.1"
}
]
"OS": [{
"id": "android",
"version": ">=0.1"
}]
},
"settingsHandlers": {
"configuration": {
Expand Down Expand Up @@ -382,18 +390,20 @@
],
"restore": [
"settings.configuration"
]
],
"isInstalled": [{
"type": "gpii.androidDeviceReporter.findService",
"name": "com.android.providers.settings"
}]
},

"com.android.settings.secure": {
"name": "Android UI Settings Secure",
"contexts": {
"OS": [
{
"id": "android",
"version": ">=0.1"
}
]
"OS": [{
"id": "android",
"version": ">=0.1"
}]
},
"settingsHandlers": {
"configuration": {
Expand Down Expand Up @@ -466,16 +476,20 @@
],
"restore": [
"settings.configuration"
]
],
"isInstalled": [{
"type": "gpii.androidDeviceReporter.findService",
"name": "com.android.providers.settings"
}]
},

"se.omnitor.ecmobile": {
"name": "Omnitor eCtouch/eCmobile",
"contexts": {
"OS": [{
"OS": [{
"id": "android",
"version": ">=0.1"
}]
}]
},
"settingsHandlers": {
"configuration": {
Expand Down Expand Up @@ -524,32 +538,36 @@
"restore": [
"settings.configuration"
],
"start": [
{
"type": "gpii.androidActivityManager.startActivityByPackageName",
"packageName": "se.omnitor.ecmobile"
}
],
"start": [{
"type": "gpii.androidActivityManager.startActivityByPackageName",
"packageName": "se.omnitor.ecmobile"
}],
"stop": [
{
"type": "gpii.androidActivityManager.stopActivityByPackageName",
"packageName": "se.omnitor.ecmobile"
},
{
}, {
"type": "gpii.androidActivityManager.goToHomeScreen"
}
],
"isInstalled": [
{
"type": "gpii.androidDeviceReporter.findService",
"name": "se.omnitor.ecmobile"
}, {
"type": "gpii.androidDeviceReporter.findService",
"name": "se.omnitor.ectouch"
}
]
},

"es.codefactory.android.app.ma": {
"name": "Mobile Accessibility",
"contexts": {
"OS": [
{
"id": "android",
"version": ">=0.1"
}
]
"OS": [{
"id": "android",
"version": ">=0.1"
}]
},
"settingsHandlers": {
"configuration": {
Expand Down Expand Up @@ -600,6 +618,10 @@
"access_commonprefs_capitalization": "http://registry\\.gpii\\.net/common/announceCapitals"
}
}
}
},
"isInstalled": [{
"type": "gpii.androidDeviceReporter.findApplication",
"name": "Mobile Accessibility"
}]
}
}
120 changes: 120 additions & 0 deletions tests/platform/android/android-dynamicDeviceReporter-testSpec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/*
GPII Integration and Acceptance Testing

Copyright 2014, 2015 Emergya

Licensed under the New BSD license. You may not use this file except in
compliance with this License.

The research leading to these results has received funding from the European Union's
Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 289016.

You may obtain a copy of the License at
https://github.com/GPII/universal/blob/master/LICENSE.txt
*/

/*global require*/

"use strict";
var fluid = require("universal"),
gpii = fluid.registerNamespace("gpii");

fluid.logObjectRenderChars = 8064;

gpii.loadTestingSupport();

fluid.registerNamespace("gpii.tests.deviceReporterAware.android.builtIn");

gpii.tests.deviceReporterAware.android.builtIn = [
{
name: "Testing os_android using Flat matchmaker",
gradeNames: "gpii.test.integration.deviceReporterAware.android",
userToken: "os_android",
settingsHandlers: {
"gpii.androidSettings": {
"some.app.id": [{
"settings": {
"dim_screen": 1,
"haptic_feedback_enabled": 1,
"accelerometer_rotation": 0,
"user_rotation": 2,
"screen_off_timeout": 10000
},
"options": {
"settingType": "System"
}
}]
},
"gpii.androidAudioManager.volume": {
"some.app.id": [{
"settings": {
"STREAM_SYSTEM": 7
}
}]
},
"gpii.androidPersistentConfiguration": {
"some.app.id": [{
"settings": {
"fontScale": 1.5,
"locale": "en"
}
}]
}
},
deviceReporters: {
"gpii.androidDeviceReporter.findService": {
"expectInstalled": [
"com.android.providers.settings",
"com.android.providers.media",
"android"
]
},
"gpii.androidDeviceReporter.findApplication": {
"expectInstalled": null
}
}
},
{
name: "Testing talkback1 using Flat matchmaker",
userToken: "talkback1",
gradeNames: "gpii.test.integration.deviceReporterAware.android",
settingsHandlers: {
"gpii.androidAudioManager.volume": {
"some.app.id": [
{
"settings": {
"STREAM_MUSIC": 14
}
}
]
},
"gpii.androidSettings": {
"some.app.id": [
{
"settings": {
"tts_default_rate": 450,
"tts_default_pitch": 450
},
"options": {
"settingType": "Secure"
}
}
]
}
},
deviceReporters: {
"gpii.androidDeviceReporter.findService": {
"expectInstalled": [
"com.android.providers.media",
"com.android.providers.settings"
]
}
}
}
];
module.exports = gpii.test.bootstrap({
testDefs: "gpii.tests.deviceReporterAware.android.builtIn",
configName: "android-dynamicDeviceReporter-config",
configPath: "configs"
}, ["gpii.test.integration.testCaseHolder.android", "gpii.test.integration.deviceReporterAware.android"],
module, require, __dirname);
Loading