[SecureElement] various fixes
authorAndrzej Krolikowski <a.krolikowsk@samsung.com>
Fri, 4 Oct 2013 13:43:38 +0000 (15:43 +0200)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Tue, 8 Oct 2013 07:15:00 +0000 (07:15 +0000)
Change-Id: I4a380f6b77180b389a23765968480ec50c04e546

39 files changed:
tct-secureelement-tizen-tests/configure.ac
tct-secureelement-tizen-tests/resources/unitcommon.js [deleted file]
tct-secureelement-tizen-tests/secureelement/ChannelSuccessCallback_notexist.html
tct-secureelement-tizen-tests/secureelement/Channel_notexist.html
tct-secureelement-tizen-tests/secureelement/Makefile.am
tct-secureelement-tizen-tests/secureelement/ReaderArraySuccessCallback_notexist.html
tct-secureelement-tizen-tests/secureelement/ReaderArraySuccessCallback_onsuccess.html
tct-secureelement-tizen-tests/secureelement/Reader_notexist.html
tct-secureelement-tizen-tests/secureelement/SEChangeListener_notexist.html
tct-secureelement-tizen-tests/secureelement/SEServiceManagerObject_notexist.html
tct-secureelement-tizen-tests/secureelement/SEService_extend.html
tct-secureelement-tizen-tests/secureelement/SEService_getReaders.html
tct-secureelement-tizen-tests/secureelement/SEService_getReaders_errorCallback_TypeMismatch.html
tct-secureelement-tizen-tests/secureelement/SEService_getReaders_errorCallback_invalid_cb.html
tct-secureelement-tizen-tests/secureelement/SEService_getReaders_exist.html
tct-secureelement-tizen-tests/secureelement/SEService_getReaders_missarg.html
tct-secureelement-tizen-tests/secureelement/SEService_getReaders_successCallback_TypeMismatch.html
tct-secureelement-tizen-tests/secureelement/SEService_getReaders_successCallback_invalid_cb.html
tct-secureelement-tizen-tests/secureelement/SEService_getReaders_with_errorCallback.html
tct-secureelement-tizen-tests/secureelement/SEService_notexist.html
tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener.html
tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_exist.html
tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_listener_TypeMismatch.html
tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_listener_empty.html
tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_listener_invalid_cb.html
tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_missarg.html
tct-secureelement-tizen-tests/secureelement/SEService_shutdown.html
tct-secureelement-tizen-tests/secureelement/SEService_shutdown_exist.html
tct-secureelement-tizen-tests/secureelement/SEService_shutdown_extra_argument.html
tct-secureelement-tizen-tests/secureelement/SEService_unregisterSEListener.html
tct-secureelement-tizen-tests/secureelement/SEService_unregisterSEListener_exist.html
tct-secureelement-tizen-tests/secureelement/SessionSuccessCallback_notexist.html
tct-secureelement-tizen-tests/secureelement/Session_notexist.html
tct-secureelement-tizen-tests/secureelement/Tizen_seService_exist.html
tct-secureelement-tizen-tests/secureelement/TransmitSuccessCallback_notexist.html
tct-secureelement-tizen-tests/secureelement/support/Makefile.am [new file with mode: 0644]
tct-secureelement-tizen-tests/secureelement/support/unitcommon.js [new file with mode: 0644]
tct-secureelement-tizen-tests/tests.full.xml
tct-secureelement-tizen-tests/tests.xml

index d0676af9a37697f5e7efc3fc1aebf8042f5f4319..faff2013093a22b0e873210a654005c2863bf83c 100644 (file)
@@ -11,6 +11,7 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign])
 
 AC_CONFIG_FILES([Makefile \
   secureelement/Makefile \
+  secureelement/support/Makefile \
   resources/Makefile \
   testkit/Makefile \
 ])
diff --git a/tct-secureelement-tizen-tests/resources/unitcommon.js b/tct-secureelement-tizen-tests/resources/unitcommon.js
deleted file mode 100644 (file)
index 9f972c1..0000000
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
-
-Copyright (c) 2013 Samsung Electronics Co., Ltd.
-
-Licensed under the Apache License, Version 2.0 (the License);
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-
-
-Authors:
-
- */
-
-
-MIN_BYTE = -128;
-MAX_BYTE = 127;
-MIN_OCTET = 0;
-MAX_OCTET = 255;
-MIN_SHORT = -32768;
-MAX_SHORT = 32767;
-MIN_UNSIGNED_SHORT = 0;
-MAX_UNSIGNED_SHORT = 65535;
-MIN_LONG = -2147483648;
-MAX_LONG = 2147483647;
-MIN_UNSIGNED_LONG = 0;
-MAX_UNSIGNED_LONG = 4294967295;
-MIN_LONG_LONG = -9223372036854775808;
-MAX_LONG_LONG = 9223372036854775807;
-MIN_UNSIGNED_LONG_LONG = 0;
-MAX_UNSIGNED_LONG_LONG = 18446744073709551615;
-
-TYPE_MISMATCH_EXCEPTION = {name: 'TypeMismatchError'};
-NOT_FOUND_EXCEPTION = {name: 'NotFoundError'};
-INVALID_VALUES_EXCEPTION = {name: 'InvalidValuesError'};
-IO_EXCEPTION = {name: 'IOError'};
-SECURITY_EXCEPTION = {name: 'SecurityError'};
-
-
-(function () {
-   var head_src = document.head.innerHTML;
-   if (head_src.search(/\/testharness.js\W/) === -1) {
-       document.write('<script language="javascript" src="../resources/testharness.js"></script>\n');
-   }
-   if (head_src.search(/\/testharnessreport.js\W/) === -1) {
-       document.write('<script language="javascript" src="../resources/testharnessreport.js"></script>\n');
-   }
-})();
-
-var _registered_types = {};
-
-function _resolve_registered_type(type) {
-    while (type in _registered_types) {
-        type = _registered_types[type];
-    }
-    return type;
-}
-
-/**
- * Method checks extra argument for none argument method.
- * The only check is that method will not throw an exception.
- * Example usage:
- * checkExtraArgument(tizen.notification, "removeAll");
- *
- * @param object object
- * @param methodName string - name of the method
- */
-function checkExtraArgument(object, methodName) {
-    var extraArgument = [
-        null,
-        undefined,
-        "Tizen",
-        1,
-        false,
-        ["one", "two"],
-        {argument: 1},
-        function () {}
-    ], i;
-
-    for (i = 0; i < extraArgument.length; i++) {
-        object[methodName](extraArgument[i]);
-    }
-}
-
-/**
- * Method to validate conversion.
- * Example usage:
- *   conversionTable = getTypeConversionExceptions("functionObject", true);
- *   for(i = 0; i < conversionTable.length; i++) {
- *       errorCallback = conversionTable[i][0];
- *       exceptionName = conversionTable[i][1];
- *
- *       assert_throws({name : exceptionName},
- *       function () {
- *           tizen.systemsetting.setProperty("HOME_SCREEN",
- *               propertyValue, successCallback, errorCallback);
- *       }, exceptionName + " should be thrown - given incorrect errorCallback.");
- *   }
- *
- * @param conversionType
- * @param isOptional
- * @returns table of tables which contain value (index 0) and exceptionName (index 1)
- *
- */
-function getTypeConversionExceptions(conversionType, isOptional) {
-    var exceptionName = "TypeMismatchError",
-        conversionTable;
-    switch (conversionType) {
-        case "enum":
-            conversionTable = [
-                [undefined, exceptionName],
-                [null, exceptionName],
-                [0, exceptionName],
-                [true, exceptionName],
-                ["dummyInvalidEnumValue", exceptionName],
-                [{ }, exceptionName]
-            ];
-            break;
-        case "double":
-            conversionTable = [
-                [undefined, exceptionName],
-                [NaN, exceptionName],
-                [Number.POSITIVE_INFINITY, exceptionName],
-                [Number.NEGATIVE_INFINITY, exceptionName],
-                ["TIZEN", exceptionName],
-                [{ name : "TIZEN" }, exceptionName],
-                [function () { }, exceptionName]
-            ];
-            break;
-        case "object":
-            conversionTable = [
-                [true, exceptionName],
-                [false, exceptionName],
-                [NaN, exceptionName],
-                [0, exceptionName],
-                ["", exceptionName],
-                ["TIZEN", exceptionName],
-                [undefined, exceptionName]
-            ];
-            if (!isOptional) {
-                conversionTable.push([null, exceptionName]);
-            }
-            break;
-        case "functionObject":
-            conversionTable = [
-                [true, exceptionName],
-                [false, exceptionName],
-                [NaN, exceptionName],
-                [0, exceptionName],
-                ["", exceptionName],
-                ["TIZEN", exceptionName],
-                [[], exceptionName],
-                [{ }, exceptionName],
-                [undefined, exceptionName]
-            ];
-            if (!isOptional) {
-                conversionTable.push([null, exceptionName]);
-            }
-            break;
-        case "array":
-            conversionTable = [
-                [true, exceptionName],
-                [false, exceptionName],
-                [NaN, exceptionName],
-                [0, exceptionName],
-                ["", exceptionName],
-                ["TIZEN", exceptionName],
-                [{ }, exceptionName],
-                [function () { }, exceptionName],
-                [undefined, exceptionName]
-            ];
-            if (!isOptional) {
-                conversionTable.push([null, exceptionName]);
-            }
-            break;
-        case "dictionary":
-            conversionTable = [
-                [true, exceptionName],
-                [false, exceptionName],
-                [NaN, exceptionName],
-                [0, exceptionName],
-                ["", exceptionName],
-                ["TIZEN", exceptionName],
-                [undefined, exceptionName]
-            ];
-            if (!isOptional) {
-                conversionTable.push([null, exceptionName]);
-            }
-            break;
-        default:
-            assert_unreached("Fix your test. Wrong conversionType '" + conversionType + "'.");
-    };
-
-    return conversionTable;
-}
-
-
-function assert_type(obj, type, description) {
-    var org_type = type, prop_name, prop_type, prop_value;
-
-    type = _resolve_registered_type(type);
-
-    if (typeof (type) === 'string') {
-        type = type.toLowerCase();
-        switch (type) {
-            case 'object':
-            case 'string':
-            case 'number':
-            case 'function':
-            case 'boolean':
-            case 'undefined':
-            case 'xml':
-                assert_equals(typeof (obj), type, description);
-                break;
-            case 'null':
-                assert_true(obj === null, description);
-                break;
-            case 'array':
-                assert_true(Array.isArray(obj), description);
-                break;
-            case 'date':
-                assert_true(obj instanceof Date, description);
-                break;
-            case 'byte':
-                assert_equals(typeof (obj), 'number', description);
-                assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low.");
-                assert_less_than_equal(obj, MAX_BYTE, description + " - value too high.");
-                assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
-                break;
-            case 'octet':
-                assert_equals(typeof (obj), 'number', description);
-                assert_greater_than_equal(obj, MIN_OCTET, description + " - value too low.");
-                assert_less_than_equal(obj, MAX_OCTET, description + " - value too high.");
-                assert_equals(obj % 1, 0, description + " - value is not an integer.");
-                break;
-            case 'short':
-                assert_equals(typeof (obj), 'number', description);
-                assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low.");
-                assert_less_than_equal(obj, MAX_SHORT, description + " - value too high.");
-                assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
-                break;
-            case 'unsigned short':
-                assert_equals(typeof (obj), 'number', description);
-                assert_greater_than_equal(obj, MIN_UNSIGNED_SHORT, description + " - value too low.");
-                assert_less_than_equal(obj, MAX_UNSIGNED_SHORT, description + " - value too high.");
-                assert_equals(obj % 1, 0, description + " - value is not an integer.");
-                break;
-            case 'long':
-                assert_equals(typeof (obj), 'number', description);
-                assert_greater_than_equal(obj, MIN_LONG, description + " - value too low.");
-                assert_less_than_equal(obj, MAX_LONG, description + " - value too high.");
-                assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
-                break;
-            case 'unsigned long':
-                assert_equals(typeof (obj), 'number', description);
-                assert_greater_than_equal(obj, MIN_UNSIGNED_LONG, description + " - value too low.");
-                assert_less_than_equal(obj, MAX_UNSIGNED_LONG, description + " - value too high.");
-                assert_equals(obj % 1, 0, description + " - value is not an integer.");
-                break;
-            case 'long long':
-                assert_equals(typeof (obj), 'number', description);
-                assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low.");
-                assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high.");
-                assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
-                break;
-            case 'unsigned long long':
-                assert_equals(typeof (obj), 'number', description);
-                assert_greater_than_equal(obj, MIN_UNSIGNED_LONG_LONG, description + " - value too low.");
-                assert_less_than_equal(obj, MAX_UNSIGNED_LONG_LONG, description + " - value too high.");
-                assert_equals(obj % 1, 0, description + " - value is not an integer.");
-                break;
-            default:
-                assert_unreached('Fix your test. Wrong type \'' + org_type + '\'');
-        }
-    } else if (typeof (type) === 'function') {
-        assert_true(obj instanceof type, description);
-    } else if (typeof (type) === 'object') {
-        for (prop_name in type) {
-            prop_type = type[prop_name];
-            if (prop_type === 'function') {
-                assert_inherits(obj, prop_name);
-                assert_equals(typeof obj[prop_name], prop_type, 'Object should have method ' + prop_name);
-            } else {
-                assert_own_property(obj, prop_name);
-            }
-        }
-    } else {
-        assert_unreached('Fix your test. Wrong type ' + org_type);
-    }
-}
-
-function register_type(alias, type_spec) {
-    _registered_types[alias] = type_spec;
-}
-
-/**
- * Method to check if attribute is const.
- * Example usage:
- * check_const(tizen.bluetooth.deviceMinor, 'TOY_DOLL', 0x03, 'number', 0x29B);
- *
- * @param obj  object to test which  has const attribute
- * @param attributeName attribute name.
- * @param expectedValue expected value of provided attribute name
- * @param expectedType expected type of provided attribute name
- * @param valueToAssign value to assign in order to check if attribute value can be modified
- */
-function check_const(obj, attributeName, expectedValue, expectedType, valueToAssign) {
-    var tmp;
-    if (expectedValue === valueToAssign) {
-        assert_unreached("Fix your test. The same values given for "  + attributeName +
-            " in 'value' and 'valueToSet' arguments.");
-    }
-    if (typeof (attributeName) === "string") {
-        assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object.");
-        assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent.");
-        if (typeof (expectedType) !== "undefined") {
-            if (expectedValue === null) {
-                assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different.");
-            } else {
-                assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different.");
-            }
-        } else {
-            assert_unreached("Fix your test. Wrong type " + expectedType);
-        }
-        tmp = obj[attributeName];
-        obj[attributeName] = valueToAssign;
-        assert_equals(obj[attributeName], tmp, attributeName + " can be modified.");
-    } else {
-        assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName));
-    }
-}
-
-/**
- * Method to check if attribute is readonly.
- * Example usage:
- * check_readonly(statusNotification, "postedTime", null, 'object', new Date());
- *
- * @param obj  object to test which  has readonly attribute
- * @param attributeName attribute name.
- * @param expectedValue expected value of provided attribute name
- * @param expectedType expected type of provided attribute name
- * @param valueToAssign value to assign in order to check if attribute value can be modified
- */
-function check_readonly(obj, attributeName, expectedValue, expectedType, valueToAssign) {
-    check_const(obj, attributeName, expectedValue, expectedType, valueToAssign);
-}
-
-/**
- * Method to check if attribute can be set to null.
- * Example usage:
- * check_not_nullable(syncInfo, "mode");
- *
- * @param obj object to test which has not nullable attribute
- * @param attributeName attribute name.
- */
-function check_not_nullable(obj, attributeName)
-{   var old_value = obj[attributeName];
-    obj[attributeName] = null;
-    assert_not_equals(obj[attributeName], null, "Attribute " + attributeName + " can be set to null.");
-    obj[attributeName] = old_value;
-}
-
-/**
- * Method to check NoInterfaceObject
- * Example usage:
- * check_no_interface_object("BluetoothAdapter")
- *
- * @param interfaceName interface name
- */
-function check_no_interface_object(interfaceName) {
-    assert_throws({name: "TypeError"}, function () {
-        tizen[interfaceName]();
-    },"Wrong call as a function");
-    assert_throws({name: "TypeError"}, function () {
-        new tizen[interfaceName]();
-    },"Wrong call as a new function");
-    assert_throws({name: "TypeError"}, function () {
-        ({}) instanceof tizen[interfaceName];
-    },"instanceof exception");
-    assert_equals(tizen[interfaceName], undefined, interfaceName + " is not undefined.");
-}
-
-
-/**
- * Method to check Constructors
- * Example usage:
- * check_constructor("BluetoothAdapter")
- *
- * @param constructorName constructor name
- */
-
-function check_constructor(constructorName) {
-    assert_true(constructorName in tizen, "No " + constructorName + " in tizen.");
-    assert_false({} instanceof tizen[constructorName],"Custom object is not instance of " + constructorName);
-    assert_throws({
-        name: "TypeError"
-    }, function () {
-        tizen[constructorName]();
-    }, "Constructor called as function.");
-}
-
-/**
- * Method to check if given method can be overridden in a given object - (TEMPORARY REMOVED).
- * That method also checks if given method exists in a given object.
- * Example usage:
- * check_method_exists(tizen.notification, "get");
- *
- * @param obj object with method
- * @param methodName name of the method to check.
- */
-function check_method_exists(obj, methodName) {
-    assert_type(obj[methodName], 'function', "Method does not exist.");
-}
-
-/**
- * Method to check extensibility of given object.
- * Method checks if new attribute and method can be added.
- * Example usage:
- * check_extensibility(tizen.notification);
- *
- * @param obj object to check
- */
-function check_extensibility(obj) {
-    var dummyAttribute = "dummyAttributeValue", dummyMethodResult = "dummyMethodResultValue";
-    obj.newDummyMethod = function() {
-        return dummyMethodResult;
-    }
-    assert_equals(obj.newDummyMethod(), dummyMethodResult, "Incorrect result from added method.");
-
-    obj.newDummyAttribute = dummyAttribute;
-    assert_equals(obj.newDummyAttribute, dummyAttribute, "Incorrect result from added attribute.");
-}
-
-/**
- * Method to check if attribute can be modify.
- * Example usage:
- * check_attr(downloadRequest, "fileName", default_val, "string", "file_name.html");
- *
- * @param obj  object to test which has not readonly attribute
- * @param attributeName attribute name.
- * @param expectedValue expected value of provided attribute name
- * @param expectedType expected type of provided attribute name
- * @param valueToAssign value to assign in order to check if attribute value can be modified
- */
-function check_attribute(obj, attributeName, expectedValue, expectedType, valueToAssign) {
-    if (expectedValue === valueToAssign) {
-        assert_unreached("Fix your test. The same values given for "  + attributeName +
-            " in 'value' and 'valueToSet' arguments.");
-    }
-    if (typeof (attributeName) === "string") {
-        assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object.");
-        assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent.");
-        if (typeof (expectedType) !== "undefined") {
-            if (expectedValue === null) {
-                assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different.");
-            } else {
-                assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different.");
-            }
-        } else {
-            assert_unreached("Fix your test. Wrong type " + expectedType);
-        }
-        obj[attributeName] = valueToAssign;
-        assert_equals(obj[attributeName], valueToAssign, attributeName + " can be modified.");
-    } else {
-        assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName));
-    }
-}
-
-/**
- * Method to check if whole array can be overwritten with an invalid value.
- * Sample usage:
- * check_invalid_array_assignments(message, "to", false);
- *
- * @param obj object which has the array as its property
- * @param array name of the array to check
- * @param isNullable indicates if the array can be null
- */
-function check_invalid_array_assignments(obj, array, isNullable) {
-    var args = [undefined, true, false, NaN, 0, "TIZEN", {}, function () {}],
-        val = obj[array], i;
-
-    if (!isNullable) {
-        obj[array] = null;
-        assert_not_equals(obj[array], null, "Non-nullable array was set to null");
-        assert_type(obj[array], "array", "Non-nullable array type changed after assigning null");
-        assert_equals(obj[array].toString(), val.toString(), "Non-nullable array contents changed after assigning null");
-    }
-
-    for (i = 0 ; i < args.length ; i++) {
-        obj[array] = args[i];
-        assert_type(obj[array], "array", "Array type changed after assigning an invalid value");
-        assert_equals(obj[array].toString(), val.toString(), "Array contents changed after assigning an invalid value");
-    }
-}
-
-/**
- * Method to check if an object can be overwritten with an invalid value.
- * Sample usage:
- * check_invalid_object_assignments(message, "body", false);
- *
- * @param parentObj object which has the 'obj' object as its property
- * @param obj name of the object to check
- * @param isNullable indicates if the object can be null
- */
-function check_invalid_obj_assignments(parentObj, obj, isNullable) {
-    var args = [undefined, true, false, NaN, 0, "TIZEN", function () {}],
-        val = parentObj[obj], i;
-
-    if (!isNullable) {
-        parentObj[obj] = null;
-        assert_equals(parentObj[obj], val, "Non-nullable obj was modified after assigning null");
-    }
-
-    for (i = 0 ; i < args.length ; i++) {
-        parentObj[obj] = args[i];
-        assert_equals(parentObj[obj], val, "The object was set to " + args[i]);
-    }
-}
-
-/**
- * Method to validate conversion for listeners.
- * Example usage:
- * incorrectListeners = getListenerConversionExceptions(["oninstalled", "onupdated", "onuninstalled"]);
- * for(i = 0; i < incorrectListeners.length; i++) {
- *     packageInformationEventCallback  = incorrectListeners[i][0];
- *     exceptionName = incorrectListeners[i][1];
- *     assert_throws({name : exceptionName},
- *        function () {
- *             tizen.package.setPackageInfoEventListener(packageInformationEventCallback);
- *         }, exceptionName + " should be thrown - given incorrect successCallback.");
- * }
- *
- *
- * @param callbackNames Array with names
- * @returns {Array} table of tables which contain incorrect listener (index 0) and exceptionName (index 1)
- *
- */
-function getListenerConversionExceptions(callbackNames) {
-    var result = [], conversionTable, i, j, listenerName;
-    conversionTable = getTypeConversionExceptions("functionObject", false);
-
-    for (i = 0; i < callbackNames.length; i++) {
-        for (j = 0; j < conversionTable.length; j++) {
-            listenerName = {};
-            listenerName[callbackNames[i]] = conversionTable[j][0];
-            result.push([listenerName, conversionTable[j][1]]);
-        }
-    }
-
-    return result;
-}
index 2646ddbc94c4d5a7818674ee661baa288f620b6a..07aa2af1fe1a060c9b6f00e7ac1863ad4ddeb556 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>ChannelSuccessCallback_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA CBNIO
 test(function () {
     check_no_interface_object("ChannelSuccessCallback");
-}, "ChannelSuccessCallback_notexist");
+}, document.title);
 
 </script>
 </body>
index c076f6f6c9733b331e8fd1e6dde715dea7239f16..f8b5144280b3ffe411ee1629b09bad8c0faba62b 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>Channel_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 //==== TEST_CRITERIA NIO
 test(function () {
     check_no_interface_object("Channel");
-}, "Channel_notexist");
+}, document.title);
 
 </script>
 </body>
index 04c1b11a57afd39cf64e96020a0cf1735522cdf3..b6ff673c135ce67c715f14e7be8e684ee139cd92 100644 (file)
@@ -1,3 +1,4 @@
-worker_DATA = *
-workerdir = /opt/tct-secureelement-tizen-tests/secureelement
-EXTRA_DIST = $(worker_DATA)
+SUBDIRS = support
+secureelement_SCRIPTS = *
+secureelementdir = /opt/tct-secureelement-tizen-tests/secureelement
+EXTRA_DIST = $(secureelement_SCRIPTS)
index 22caaf48f1d910259312d9b1d78f85e4fe8ab5b6..ef8673048eef08109db4913cc9a904e3f9fccf28 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>ReaderArraySuccessCallback_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA CBNIO
 test(function () {
     check_no_interface_object("ReaderArraySuccessCallback");
-}, "ReaderArraySuccessCallback_notexist");
+}, document.title);
 
 </script>
 </body>
index e1b5e99b064a23b54a82af93e1564f9efa68ef21..0be76df90d9ea841702f5338067a23c9bcbff5e6 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>ReaderArraySuccessCallback_onsuccess</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== ONLOAD_DELAY 90
 //==== TEST_CRITERIA CBOA
 setup({timeout: 90000});
-var t = async_test(document.title, {timeout: 90000} ), onSuccess, onError;
+var t = async_test(document.title, {timeout: 90000}), onSuccess, onError;
 
 t.step(function () {
 
index acf41a7f8cf66ad1fd68a0b6dbff96a3ea70fc76..d2c7ebda80e3724d84e7bb1ae5d4f73e8beb35e9 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>Reader_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 //==== TEST_CRITERIA NIO
 test(function () {
     check_no_interface_object("Reader");
-}, "Reader_notexist");
+}, document.title);
 
 </script>
 </body>
index 3ac6a854fa3ad20ec1e12049c49da07998561e59..72159acafbf865478e8479e859dde1f819afe20b 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>SEChangeListener_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 //==== TEST_CRITERIA CBNIO
 test(function () {
     check_no_interface_object("SEChangeListener");
-}, "SEChangeListener_notexist");
+}, document.title);
 
 </script>
 </body>
index 30beaa33bf602891f6bbc6a7107e7dd43331c564..b0c151e29f80dce45d452852fcabe64576158e59 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>SEServiceManagerObject_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 //==== TEST_CRITERIA NIO
 test(function () {
     check_no_interface_object("SEServiceManagerObject");
-}, "SEServiceManagerObject_notexist");
+}, document.title);
 
 </script>
 </body>
index 4c20deb255ace96993d4b6693bace6a803b75333..c2add9720f557e10281bb79abeb41b50237921d3 100644 (file)
@@ -23,21 +23,21 @@ Authors:
 <head>
 <title>SEService_extend</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
 <div id="log"></div>
 <script>
 //==== TEST: SEService_extend
-//==== LABEL test whether the SEServiceManager object can have new attribute added
+//==== LABEL Test whether the SEServiceManager object can have new attribute added
 //==== PRIORITY: P3
 //==== SPEC Tizen Web API:Communication:SE:SEService:SEService U
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html
 //==== TEST_CRITERIA OBX
 test(function () {
     check_extensibility(tizen.seService);
-}, "SEService_extend");
+}, document.title);
 
 </script>
 </body>
index d5cd545bf001348893629efc70bfd745c00ad7cc..a4b13d990a52aaee585d5d3aeb9c7530aac7fb0c 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>SEService_getReaders</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -41,7 +41,7 @@ Authors:
 
 setup({timeout: 90000});
 
-var t = async_test("SEService_getReaders", {timeout: 90000}), getReadersSuccessCallback;
+var t = async_test(document.title, {timeout: 90000}), getReadersSuccessCallback;
 
 t.step(function () {
     getReadersSuccessCallback = t.step_func(function (readers) {
index 9bd5c3ffe8ad592aa8b8ae2a1f177e4abd2654ec..eeb88fd9910905959369cd363bb0ccf050758dbc 100644 (file)
@@ -25,7 +25,7 @@ Authors:
 <html>
 <head>
 <title>SEService_getReaders_errorCallback_TypeMismatch</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 <body>
 <div id="log"></div>
@@ -55,7 +55,7 @@ t.step(function () {
         incorrectErrorCallback = conversionTable[i][0];
         exceptionName = conversionTable[i][1];
 
-        assert_throws({name : exceptionName},
+        assert_throws({name: exceptionName},
             function () {
             tizen.seService.getReaders(successCallback, incorrectErrorCallback);
         }, exceptionName + " should be thrown - given incorrect errorCallback.");
index 927c71f32583e14cc8a357107d923f8c021d8a7f..0d2d237dd3565feee7e9bb7cd79f95d14f1d484b 100644 (file)
@@ -22,21 +22,21 @@ Authors:
 <html>
 <head>
 <title>SEService_getReaders_errorCallback_invalid_cb</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 <body>
 <div id="log"></div>
 <script type="text/javascript">
 //==== TEST: SEService_getReaders_errorCallback_invalid_cb
-//==== LABEL getReaders - check argument errorCallback validation - use {onerror: function (){}}
+//==== LABEL GetReaders - check argument errorCallback validation - use {onerror: function (){}}
 //==== PRIORITY: P2
 //==== SPEC: Tizen Web API:Communication:SE:SEService:getReaders M
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html
 //==== ONLOAD_DELAY 90
 //==== TEST_CRITERIA MTCB
 setup({timeout: 90000});
-var t = async_test(document.title, { timeout: 90000 }), incorrectCallback,
-    exceptionName = "TypeMismatchError", successCallback;
+var t = async_test(document.title, {timeout: 90000}), incorrectCallback,
+    successCallback;
 t.step(function () {
 
     incorrectCallback = {
@@ -49,9 +49,9 @@ t.step(function () {
         assert_unreached("successCallback invoked.");
     });
 
-    assert_throws({name: exceptionName}, function () {
+    assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
         tizen.seService.getReaders(successCallback, incorrectCallback);
-    }, exceptionName + " should be thrown - given incorrect error callback.");
+    }, "Given incorrect error callback");
 
     tizen.seService.shutdown();
     t.done();
index 1fb5e158f3597f3750e551c8aa11822e6efbdae8..9f080851e0d1722949ff3c691de701342041668c 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>SEService_getReaders_exist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 test(function () {
     assert_true("getReaders" in tizen.seService, "getReaders method exists");
     check_method_exists(tizen.seService, "getReaders");
-}, "SEService_getReaders_exist");
+}, document.title);
 
 </script>
 </body>
index a3a964010e380df6b3d089f9466ccd123fff9b36..aa116c2608e0c6fa980e19094eb061590cff201a 100644 (file)
@@ -22,7 +22,7 @@ Authors:
 <html>
 <head>
 <title>SEService_getReaders_missarg</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -34,7 +34,7 @@ Authors:
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html
 //==== TEST_CRITERIA MMA
 test(function () {
-    assert_throws({ name: "TypeMismatchError" }, function () {
+    assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
         tizen.seService.getReaders();
     }, "Calling getReaders without arguments should throw an exception.");
 }, document.title);
index 666dc0bb841d6fa7f32af60b44792202ac12fab1..b54d9994f4a0185501bd45b964aa6cef7cf6d514 100644 (file)
@@ -25,7 +25,7 @@ Authors:
 <html>
 <head>
 <title>SEService_getReaders_successCallback_TypeMismatch</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 <body>
 <div id="log"></div>
@@ -51,7 +51,7 @@ t.step(function () {
         successCallback = conversionTable[i][0];
         exceptionName = conversionTable[i][1];
 
-        assert_throws({name : exceptionName},
+        assert_throws({name: exceptionName},
             function () {
             tizen.seService.getReaders(successCallback);
         }, exceptionName + " should be thrown - given incorrect successCallback.");
index 9a949aac31e90c7c338f2d5b795e50be67382671..778ab5cfde2eefcfc531fc12a73ffc88d2ae5d0f 100644 (file)
@@ -22,21 +22,20 @@ Authors:
 <html>
 <head>
 <title>SEService_getReaders_successCallback_invalid_cb</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 <body>
 <div id="log"></div>
 <script type="text/javascript">
 //==== TEST: SEService_getReaders_successCallback_invalid_cb
-//==== LABEL getReaders - check argument successCallback validation - use {onsuccess: function (){}}
+//==== LABEL GetReaders - check argument successCallback validation - use {onsuccess: function (){}}
 //==== PRIORITY: P2
 //==== SPEC: Tizen Web API:Communication:SE:SEService:getReaders M
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html
 //==== ONLOAD_DELAY 90
 //==== TEST_CRITERIA MTCB
 setup({timeout: 90000});
-var t = async_test(document.title, { timeout: 90000 }), incorrectCallback,
-    exceptionName = "TypeMismatchError";
+var t = async_test(document.title, {timeout: 90000}), incorrectCallback;
 t.step(function () {
 
     incorrectCallback = {
@@ -44,11 +43,9 @@ t.step(function () {
             assert_unreached("Invalid successCallback invoked: ");
         })
     };
-    assert_throws({
-        name: exceptionName
-    }, function () {
+    assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
         tizen.seService.getReaders(incorrectCallback);
-    }, exceptionName + " should be thrown - given incorrect success callback.");
+    }, "Given incorrect success callback");
     tizen.seService.shutdown();
     t.done();
 });
index 373decc472737ff458511e7620c00abda6d85aca..82c94fb89e049cb8c6adcda877ed0d12f3eb0cba 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <meta charset="utf-8"/>
 <title>SEService_getReaders_with_errorCallback</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 <body>
 <div id="log"></div>
@@ -38,7 +38,7 @@ Authors:
 //==== TEST_CRITERIA MOA
 setup({timeout: 90000});
 
-var t = async_test("SEService_getReaders_with_errorCallback", {timeout: 90000}), getReadersSuccessCallback, getReadersErrorCallback;
+var t = async_test(document.title, {timeout: 90000}), getReadersSuccessCallback, getReadersErrorCallback;
 
 t.step(function () {
     getReadersSuccessCallback = t.step_func(function (readers) {
index ce3923374834e2197bc61077805a2085640d1134..a4d8567a089fcf64e1ae00b675350a8b01df145e 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>SEService_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 //==== TEST_CRITERIA NIO
 test(function () {
     check_no_interface_object("SEService");
-}, "SEService_notexist");
+}, document.title);
 
 </script>
 </body>
index ffb1a6e19bd369dcfe5517e4c52f7d8d36bb0c7e..1e275a6dee147fcd7573b6159767813491e3c5cc 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>SEService_registerSEListener</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 //==== ONLOAD_DELAY 90
 //==== TEST_CRITERIA MMINA MR
 setup({timeout: 90000});
-var t = async_test("SEService_registerSEListener", {timeout: 90000}),
+var t = async_test(document.title, {timeout: 90000}),
     listenerId, listener;
 t.step(function () {
     listener = {
index 5276446318aff07e1185973d849a559d132c2096..3faeeaf2a4757c156ac467b34db4491cd1537702 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>SEService_registerSEListener_exist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 test(function () {
     assert_true("registerSEListener" in tizen.seService, "registerSEListener method exists");
     check_method_exists(tizen.seService, "registerSEListener");
-}, "SEService_registerSEListener_exist");
+}, document.title);
 
 </script>
 </body>
index ec574cd43f62d22bece598af0ba71507bf5d4234..525523c85c26a78979ca90dfd84c161b41b5501f 100644 (file)
@@ -22,14 +22,14 @@ Authors:
 <html>
 <head>
 <title>SEService_registerSEListener_listener_TypeMismatch</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
 <div id="log"></div>
 <script type="text/javascript">
 //==== TEST: SEService_registerSEListener_listener_TypeMismatch
-//==== LABEL check if registerSEListener of SEService throws exception when argument is incorrect
+//==== LABEL Check if registerSEListener of SEService throws exception when argument is incorrect
 //==== PRIORITY P2
 //==== SPEC Tizen Web API:Communication:SE:SEService:registerSEListener M
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html
@@ -37,19 +37,19 @@ Authors:
 //==== TEST_CRITERIA MC
 setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), i,
-    conversionTable, SEChangeListener, exceptionName;
+    conversionTable, seChangeListener, exceptionName;
 
 t.step(function () {
     conversionTable = getTypeConversionExceptions("object", false);
 
     for(i = 0; i < conversionTable.length; i++) {
-        SEChangeListener = conversionTable[i][0];
+        seChangeListener = conversionTable[i][0];
         exceptionName = conversionTable[i][1];
 
-        assert_throws({name : exceptionName},
+        assert_throws({name: exceptionName},
             function () {
-            tizen.seService.registerSEListener(SEChangeListener);
-        }, exceptionName + " should be thrown - given incorrect SEChangeListener - " + SEChangeListener);
+            tizen.seService.registerSEListener(seChangeListener);
+        }, exceptionName + " should be thrown - given incorrect SEChangeListener - " + seChangeListener);
     }
     tizen.seService.shutdown();
     t.done();
index c89402ea91fd74666f8aa127a01dff5dadd8c663..7f268b01ba3bda1c991860b31134daee74d67a6c 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>SEService_registerSEListener_listener_empty</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -45,7 +45,7 @@ test(function () {
     tizen.seService.unregisterSEListener(listenerId);
     tizen.seService.shutdown();
 
-}, "SEService_registerSEListener_listener_empty");
+}, document.title);
 
 </script>
 </body>
index 938776521d497c085b537bffd5dfab4c3d25e3da..dfb76993a19a7ed13980bdd5177b710130c401fd 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <meta charset="utf-8"/>
 <title>SEService_registerSEListener_listener_invalid_cb</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -32,9 +32,8 @@ Authors:
 <script type="text/javascript">
 
 //==== TEST: SEService_registerSEListener_listener_invalid_cb
-//==== LABEL check if registerSEListener of SEService throws exception when listener is invalid
+//==== LABEL Check if registerSEListener of SEService throws exception when listener is invalid
 //==== PRIORITY P2
-//==== LABEL Check argument listener validation - use simple function
 //==== SPEC Tizen Web API:Communication:SE:SEService:registerSEListener M
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html
 //==== TEST_CRITERIA MTL
@@ -47,13 +46,13 @@ test(function () {
         incorrectListener  = conversionTable[i][0];
         exceptionName = conversionTable[i][1];
 
-        assert_throws({name : exceptionName},
+        assert_throws({name: exceptionName},
            function () {
                 tizen.seService.registerSEListener(incorrectListener);
             }, exceptionName + " should be thrown - given incorrect listener.");
     }
 
-}, "SEService_registerSEListener_listener_invalid_cb");
+}, document.title);
 
 </script>
 </body>
index 363b2f515eee0aea575c07762e0cd5a54d229c70..3989cab1087f8886b5ab04c9fbb0d35b813b768d 100644 (file)
@@ -22,7 +22,7 @@ Authors:
 <html>
 <head>
 <title>SEService_registerSEListener_missarg</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -34,7 +34,7 @@ Authors:
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html
 //==== TEST_CRITERIA MMA
 test(function () {
-    assert_throws({ name: "TypeMismatchError" }, function () {
+    assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
         tizen.seService.registerSEListener();
     }, "Calling registerSEListener without arguments should throw an exception.");
 }, document.title);
index 754bbb3e3bfd2d5f35d04c534f3eb053e22a0f0b..8d20b499afeb3c5c09da9ce8e5a4a1ce06739e1f 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>SEService_shutdown</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -41,7 +41,7 @@ test(function () {
     var retVal = null;
     retVal = tizen.seService.shutdown();
     assert_equals(retVal, undefined, "shutdown() should return undefined.");
-}, "SEService_shutdown");
+}, document.title);
 
 </script>
 </body>
index c743625757d000f0b2390ebb8a6e5db9cf0f2727..0093dd989d86b314f9f82d4e454fb822c95a69c1 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>SEService_shutdown_exist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 test(function () {
     assert_true("shutdown" in tizen.seService, "shutdown method exists");
     check_method_exists(tizen.seService, "shutdown");
-}, "SEService_shutdown_exist");
+}, document.title);
 
 </script>
 </body>
index 9efd973daaf867414a63836b0b2f6f5530147bb0..c6a4aee8834e494c736a0bb90e151285c213ceab 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>SEService_shutdown_extra_argument</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 test(function () {
     checkExtraArgument(tizen.seService, "shutdown");
 
-});
+}, document.title);
 
 </script>
 </body>
index 5a6ad2b5a4eedd677fa8ec86d7f31141a2cd2279..c2f5adb6ac112ff77b806e089a08d893e9dab4f9 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>SEService_unregisterSEListener</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== ONLOAD_DELAY 90
 //==== TEST_CRITERIA MMINA MR
 setup({timeout: 90000});
-var t = async_test("SEService_unregisterSEListener", {timeout: 90000}),
+var t = async_test(document.title, {timeout: 90000}),
     listenerId, listener, returnedValue = null;
 
 t.step(function () {
index 8c55ec31e742ffc319bf4afd5ed6c081024d4ca0..3f5f4113060b6edb4655873d4a2a4f59c2029a39 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>SEService_unregisterSEListener_exist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -39,7 +39,7 @@ Authors:
 test(function () {
     assert_true("unregisterSEListener" in tizen.seService, "unregisterSEListener method exists");
     check_method_exists(tizen.seService, "unregisterSEListener");
-}, "SEService_unregisterSEListener_exist");
+}, document.title);
 
 </script>
 </body>
index c98ad81e1cbd88fd2c4e3a7c240cbb8463f9d0bc..fce5985f2058cff4e551273e54e529c432b58285 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>SessionSuccessCallback_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 //==== TEST_CRITERIA CBNIO
 test(function () {
     check_no_interface_object("SessionSuccessCallback");
-}, "SessionSuccessCallback_notexist");
+}, document.title);
 
 </script>
 </body>
index 22532c53db3eabeb616641434b33b8ca5ae6ef7f..dcd450d211054f02fa56afc53858d9f7e61fc3c7 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>Session_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 //==== TEST_CRITERIA NIO
 test(function () {
     check_no_interface_object("Session");
-}, "Session_notexist");
+}, document.title);
 
 </script>
 </body>
index e389579fe090349b1c2398786adbc93c4b3d566a..c15cc0d568ec03ac349746cf26e5a9b55a9b9333 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>Tizen_seService_exist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 test(function () {
     assert_own_property(tizen, "seService", "Tizen should implement SEServiceManagerObject");
     assert_equals(typeof(tizen.seService), "object", "tizen.seService should be object");
-}, "Tizen_seService_exist");
+}, document.title);
 
 </script>
 </body>
index b22c8801af68086d0532382b119d1b339be631aa..4e47f05001f6338d438699b2f65407336345b768 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>TransmitSuccessCallback_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 //==== TEST_CRITERIA CBNIO
 test(function () {
     check_no_interface_object("TransmitSuccessCallback");
-}, "TransmitSuccessCallback_notexist");
+}, document.title);
 
 </script>
 </body>
diff --git a/tct-secureelement-tizen-tests/secureelement/support/Makefile.am b/tct-secureelement-tizen-tests/secureelement/support/Makefile.am
new file mode 100644 (file)
index 0000000..b3dfc51
--- /dev/null
@@ -0,0 +1,3 @@
+supportdir = /opt/tct-secureelement-tizen-tests/secureelement/support
+support_SCRIPTS = *.js
+EXTRA_DIST = $(support_SCRIPTS)
diff --git a/tct-secureelement-tizen-tests/secureelement/support/unitcommon.js b/tct-secureelement-tizen-tests/secureelement/support/unitcommon.js
new file mode 100644 (file)
index 0000000..9f972c1
--- /dev/null
@@ -0,0 +1,559 @@
+/*
+
+Copyright (c) 2013 Samsung Electronics Co., Ltd.
+
+Licensed under the Apache License, Version 2.0 (the License);
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+
+Authors:
+
+ */
+
+
+MIN_BYTE = -128;
+MAX_BYTE = 127;
+MIN_OCTET = 0;
+MAX_OCTET = 255;
+MIN_SHORT = -32768;
+MAX_SHORT = 32767;
+MIN_UNSIGNED_SHORT = 0;
+MAX_UNSIGNED_SHORT = 65535;
+MIN_LONG = -2147483648;
+MAX_LONG = 2147483647;
+MIN_UNSIGNED_LONG = 0;
+MAX_UNSIGNED_LONG = 4294967295;
+MIN_LONG_LONG = -9223372036854775808;
+MAX_LONG_LONG = 9223372036854775807;
+MIN_UNSIGNED_LONG_LONG = 0;
+MAX_UNSIGNED_LONG_LONG = 18446744073709551615;
+
+TYPE_MISMATCH_EXCEPTION = {name: 'TypeMismatchError'};
+NOT_FOUND_EXCEPTION = {name: 'NotFoundError'};
+INVALID_VALUES_EXCEPTION = {name: 'InvalidValuesError'};
+IO_EXCEPTION = {name: 'IOError'};
+SECURITY_EXCEPTION = {name: 'SecurityError'};
+
+
+(function () {
+   var head_src = document.head.innerHTML;
+   if (head_src.search(/\/testharness.js\W/) === -1) {
+       document.write('<script language="javascript" src="../resources/testharness.js"></script>\n');
+   }
+   if (head_src.search(/\/testharnessreport.js\W/) === -1) {
+       document.write('<script language="javascript" src="../resources/testharnessreport.js"></script>\n');
+   }
+})();
+
+var _registered_types = {};
+
+function _resolve_registered_type(type) {
+    while (type in _registered_types) {
+        type = _registered_types[type];
+    }
+    return type;
+}
+
+/**
+ * Method checks extra argument for none argument method.
+ * The only check is that method will not throw an exception.
+ * Example usage:
+ * checkExtraArgument(tizen.notification, "removeAll");
+ *
+ * @param object object
+ * @param methodName string - name of the method
+ */
+function checkExtraArgument(object, methodName) {
+    var extraArgument = [
+        null,
+        undefined,
+        "Tizen",
+        1,
+        false,
+        ["one", "two"],
+        {argument: 1},
+        function () {}
+    ], i;
+
+    for (i = 0; i < extraArgument.length; i++) {
+        object[methodName](extraArgument[i]);
+    }
+}
+
+/**
+ * Method to validate conversion.
+ * Example usage:
+ *   conversionTable = getTypeConversionExceptions("functionObject", true);
+ *   for(i = 0; i < conversionTable.length; i++) {
+ *       errorCallback = conversionTable[i][0];
+ *       exceptionName = conversionTable[i][1];
+ *
+ *       assert_throws({name : exceptionName},
+ *       function () {
+ *           tizen.systemsetting.setProperty("HOME_SCREEN",
+ *               propertyValue, successCallback, errorCallback);
+ *       }, exceptionName + " should be thrown - given incorrect errorCallback.");
+ *   }
+ *
+ * @param conversionType
+ * @param isOptional
+ * @returns table of tables which contain value (index 0) and exceptionName (index 1)
+ *
+ */
+function getTypeConversionExceptions(conversionType, isOptional) {
+    var exceptionName = "TypeMismatchError",
+        conversionTable;
+    switch (conversionType) {
+        case "enum":
+            conversionTable = [
+                [undefined, exceptionName],
+                [null, exceptionName],
+                [0, exceptionName],
+                [true, exceptionName],
+                ["dummyInvalidEnumValue", exceptionName],
+                [{ }, exceptionName]
+            ];
+            break;
+        case "double":
+            conversionTable = [
+                [undefined, exceptionName],
+                [NaN, exceptionName],
+                [Number.POSITIVE_INFINITY, exceptionName],
+                [Number.NEGATIVE_INFINITY, exceptionName],
+                ["TIZEN", exceptionName],
+                [{ name : "TIZEN" }, exceptionName],
+                [function () { }, exceptionName]
+            ];
+            break;
+        case "object":
+            conversionTable = [
+                [true, exceptionName],
+                [false, exceptionName],
+                [NaN, exceptionName],
+                [0, exceptionName],
+                ["", exceptionName],
+                ["TIZEN", exceptionName],
+                [undefined, exceptionName]
+            ];
+            if (!isOptional) {
+                conversionTable.push([null, exceptionName]);
+            }
+            break;
+        case "functionObject":
+            conversionTable = [
+                [true, exceptionName],
+                [false, exceptionName],
+                [NaN, exceptionName],
+                [0, exceptionName],
+                ["", exceptionName],
+                ["TIZEN", exceptionName],
+                [[], exceptionName],
+                [{ }, exceptionName],
+                [undefined, exceptionName]
+            ];
+            if (!isOptional) {
+                conversionTable.push([null, exceptionName]);
+            }
+            break;
+        case "array":
+            conversionTable = [
+                [true, exceptionName],
+                [false, exceptionName],
+                [NaN, exceptionName],
+                [0, exceptionName],
+                ["", exceptionName],
+                ["TIZEN", exceptionName],
+                [{ }, exceptionName],
+                [function () { }, exceptionName],
+                [undefined, exceptionName]
+            ];
+            if (!isOptional) {
+                conversionTable.push([null, exceptionName]);
+            }
+            break;
+        case "dictionary":
+            conversionTable = [
+                [true, exceptionName],
+                [false, exceptionName],
+                [NaN, exceptionName],
+                [0, exceptionName],
+                ["", exceptionName],
+                ["TIZEN", exceptionName],
+                [undefined, exceptionName]
+            ];
+            if (!isOptional) {
+                conversionTable.push([null, exceptionName]);
+            }
+            break;
+        default:
+            assert_unreached("Fix your test. Wrong conversionType '" + conversionType + "'.");
+    };
+
+    return conversionTable;
+}
+
+
+function assert_type(obj, type, description) {
+    var org_type = type, prop_name, prop_type, prop_value;
+
+    type = _resolve_registered_type(type);
+
+    if (typeof (type) === 'string') {
+        type = type.toLowerCase();
+        switch (type) {
+            case 'object':
+            case 'string':
+            case 'number':
+            case 'function':
+            case 'boolean':
+            case 'undefined':
+            case 'xml':
+                assert_equals(typeof (obj), type, description);
+                break;
+            case 'null':
+                assert_true(obj === null, description);
+                break;
+            case 'array':
+                assert_true(Array.isArray(obj), description);
+                break;
+            case 'date':
+                assert_true(obj instanceof Date, description);
+                break;
+            case 'byte':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_BYTE, description + " - value too high.");
+                assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
+                break;
+            case 'octet':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_OCTET, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_OCTET, description + " - value too high.");
+                assert_equals(obj % 1, 0, description + " - value is not an integer.");
+                break;
+            case 'short':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_SHORT, description + " - value too high.");
+                assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
+                break;
+            case 'unsigned short':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_UNSIGNED_SHORT, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_UNSIGNED_SHORT, description + " - value too high.");
+                assert_equals(obj % 1, 0, description + " - value is not an integer.");
+                break;
+            case 'long':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_LONG, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_LONG, description + " - value too high.");
+                assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
+                break;
+            case 'unsigned long':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_UNSIGNED_LONG, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_UNSIGNED_LONG, description + " - value too high.");
+                assert_equals(obj % 1, 0, description + " - value is not an integer.");
+                break;
+            case 'long long':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high.");
+                assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
+                break;
+            case 'unsigned long long':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_UNSIGNED_LONG_LONG, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_UNSIGNED_LONG_LONG, description + " - value too high.");
+                assert_equals(obj % 1, 0, description + " - value is not an integer.");
+                break;
+            default:
+                assert_unreached('Fix your test. Wrong type \'' + org_type + '\'');
+        }
+    } else if (typeof (type) === 'function') {
+        assert_true(obj instanceof type, description);
+    } else if (typeof (type) === 'object') {
+        for (prop_name in type) {
+            prop_type = type[prop_name];
+            if (prop_type === 'function') {
+                assert_inherits(obj, prop_name);
+                assert_equals(typeof obj[prop_name], prop_type, 'Object should have method ' + prop_name);
+            } else {
+                assert_own_property(obj, prop_name);
+            }
+        }
+    } else {
+        assert_unreached('Fix your test. Wrong type ' + org_type);
+    }
+}
+
+function register_type(alias, type_spec) {
+    _registered_types[alias] = type_spec;
+}
+
+/**
+ * Method to check if attribute is const.
+ * Example usage:
+ * check_const(tizen.bluetooth.deviceMinor, 'TOY_DOLL', 0x03, 'number', 0x29B);
+ *
+ * @param obj  object to test which  has const attribute
+ * @param attributeName attribute name.
+ * @param expectedValue expected value of provided attribute name
+ * @param expectedType expected type of provided attribute name
+ * @param valueToAssign value to assign in order to check if attribute value can be modified
+ */
+function check_const(obj, attributeName, expectedValue, expectedType, valueToAssign) {
+    var tmp;
+    if (expectedValue === valueToAssign) {
+        assert_unreached("Fix your test. The same values given for "  + attributeName +
+            " in 'value' and 'valueToSet' arguments.");
+    }
+    if (typeof (attributeName) === "string") {
+        assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object.");
+        assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent.");
+        if (typeof (expectedType) !== "undefined") {
+            if (expectedValue === null) {
+                assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different.");
+            } else {
+                assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different.");
+            }
+        } else {
+            assert_unreached("Fix your test. Wrong type " + expectedType);
+        }
+        tmp = obj[attributeName];
+        obj[attributeName] = valueToAssign;
+        assert_equals(obj[attributeName], tmp, attributeName + " can be modified.");
+    } else {
+        assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName));
+    }
+}
+
+/**
+ * Method to check if attribute is readonly.
+ * Example usage:
+ * check_readonly(statusNotification, "postedTime", null, 'object', new Date());
+ *
+ * @param obj  object to test which  has readonly attribute
+ * @param attributeName attribute name.
+ * @param expectedValue expected value of provided attribute name
+ * @param expectedType expected type of provided attribute name
+ * @param valueToAssign value to assign in order to check if attribute value can be modified
+ */
+function check_readonly(obj, attributeName, expectedValue, expectedType, valueToAssign) {
+    check_const(obj, attributeName, expectedValue, expectedType, valueToAssign);
+}
+
+/**
+ * Method to check if attribute can be set to null.
+ * Example usage:
+ * check_not_nullable(syncInfo, "mode");
+ *
+ * @param obj object to test which has not nullable attribute
+ * @param attributeName attribute name.
+ */
+function check_not_nullable(obj, attributeName)
+{   var old_value = obj[attributeName];
+    obj[attributeName] = null;
+    assert_not_equals(obj[attributeName], null, "Attribute " + attributeName + " can be set to null.");
+    obj[attributeName] = old_value;
+}
+
+/**
+ * Method to check NoInterfaceObject
+ * Example usage:
+ * check_no_interface_object("BluetoothAdapter")
+ *
+ * @param interfaceName interface name
+ */
+function check_no_interface_object(interfaceName) {
+    assert_throws({name: "TypeError"}, function () {
+        tizen[interfaceName]();
+    },"Wrong call as a function");
+    assert_throws({name: "TypeError"}, function () {
+        new tizen[interfaceName]();
+    },"Wrong call as a new function");
+    assert_throws({name: "TypeError"}, function () {
+        ({}) instanceof tizen[interfaceName];
+    },"instanceof exception");
+    assert_equals(tizen[interfaceName], undefined, interfaceName + " is not undefined.");
+}
+
+
+/**
+ * Method to check Constructors
+ * Example usage:
+ * check_constructor("BluetoothAdapter")
+ *
+ * @param constructorName constructor name
+ */
+
+function check_constructor(constructorName) {
+    assert_true(constructorName in tizen, "No " + constructorName + " in tizen.");
+    assert_false({} instanceof tizen[constructorName],"Custom object is not instance of " + constructorName);
+    assert_throws({
+        name: "TypeError"
+    }, function () {
+        tizen[constructorName]();
+    }, "Constructor called as function.");
+}
+
+/**
+ * Method to check if given method can be overridden in a given object - (TEMPORARY REMOVED).
+ * That method also checks if given method exists in a given object.
+ * Example usage:
+ * check_method_exists(tizen.notification, "get");
+ *
+ * @param obj object with method
+ * @param methodName name of the method to check.
+ */
+function check_method_exists(obj, methodName) {
+    assert_type(obj[methodName], 'function', "Method does not exist.");
+}
+
+/**
+ * Method to check extensibility of given object.
+ * Method checks if new attribute and method can be added.
+ * Example usage:
+ * check_extensibility(tizen.notification);
+ *
+ * @param obj object to check
+ */
+function check_extensibility(obj) {
+    var dummyAttribute = "dummyAttributeValue", dummyMethodResult = "dummyMethodResultValue";
+    obj.newDummyMethod = function() {
+        return dummyMethodResult;
+    }
+    assert_equals(obj.newDummyMethod(), dummyMethodResult, "Incorrect result from added method.");
+
+    obj.newDummyAttribute = dummyAttribute;
+    assert_equals(obj.newDummyAttribute, dummyAttribute, "Incorrect result from added attribute.");
+}
+
+/**
+ * Method to check if attribute can be modify.
+ * Example usage:
+ * check_attr(downloadRequest, "fileName", default_val, "string", "file_name.html");
+ *
+ * @param obj  object to test which has not readonly attribute
+ * @param attributeName attribute name.
+ * @param expectedValue expected value of provided attribute name
+ * @param expectedType expected type of provided attribute name
+ * @param valueToAssign value to assign in order to check if attribute value can be modified
+ */
+function check_attribute(obj, attributeName, expectedValue, expectedType, valueToAssign) {
+    if (expectedValue === valueToAssign) {
+        assert_unreached("Fix your test. The same values given for "  + attributeName +
+            " in 'value' and 'valueToSet' arguments.");
+    }
+    if (typeof (attributeName) === "string") {
+        assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object.");
+        assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent.");
+        if (typeof (expectedType) !== "undefined") {
+            if (expectedValue === null) {
+                assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different.");
+            } else {
+                assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different.");
+            }
+        } else {
+            assert_unreached("Fix your test. Wrong type " + expectedType);
+        }
+        obj[attributeName] = valueToAssign;
+        assert_equals(obj[attributeName], valueToAssign, attributeName + " can be modified.");
+    } else {
+        assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName));
+    }
+}
+
+/**
+ * Method to check if whole array can be overwritten with an invalid value.
+ * Sample usage:
+ * check_invalid_array_assignments(message, "to", false);
+ *
+ * @param obj object which has the array as its property
+ * @param array name of the array to check
+ * @param isNullable indicates if the array can be null
+ */
+function check_invalid_array_assignments(obj, array, isNullable) {
+    var args = [undefined, true, false, NaN, 0, "TIZEN", {}, function () {}],
+        val = obj[array], i;
+
+    if (!isNullable) {
+        obj[array] = null;
+        assert_not_equals(obj[array], null, "Non-nullable array was set to null");
+        assert_type(obj[array], "array", "Non-nullable array type changed after assigning null");
+        assert_equals(obj[array].toString(), val.toString(), "Non-nullable array contents changed after assigning null");
+    }
+
+    for (i = 0 ; i < args.length ; i++) {
+        obj[array] = args[i];
+        assert_type(obj[array], "array", "Array type changed after assigning an invalid value");
+        assert_equals(obj[array].toString(), val.toString(), "Array contents changed after assigning an invalid value");
+    }
+}
+
+/**
+ * Method to check if an object can be overwritten with an invalid value.
+ * Sample usage:
+ * check_invalid_object_assignments(message, "body", false);
+ *
+ * @param parentObj object which has the 'obj' object as its property
+ * @param obj name of the object to check
+ * @param isNullable indicates if the object can be null
+ */
+function check_invalid_obj_assignments(parentObj, obj, isNullable) {
+    var args = [undefined, true, false, NaN, 0, "TIZEN", function () {}],
+        val = parentObj[obj], i;
+
+    if (!isNullable) {
+        parentObj[obj] = null;
+        assert_equals(parentObj[obj], val, "Non-nullable obj was modified after assigning null");
+    }
+
+    for (i = 0 ; i < args.length ; i++) {
+        parentObj[obj] = args[i];
+        assert_equals(parentObj[obj], val, "The object was set to " + args[i]);
+    }
+}
+
+/**
+ * Method to validate conversion for listeners.
+ * Example usage:
+ * incorrectListeners = getListenerConversionExceptions(["oninstalled", "onupdated", "onuninstalled"]);
+ * for(i = 0; i < incorrectListeners.length; i++) {
+ *     packageInformationEventCallback  = incorrectListeners[i][0];
+ *     exceptionName = incorrectListeners[i][1];
+ *     assert_throws({name : exceptionName},
+ *        function () {
+ *             tizen.package.setPackageInfoEventListener(packageInformationEventCallback);
+ *         }, exceptionName + " should be thrown - given incorrect successCallback.");
+ * }
+ *
+ *
+ * @param callbackNames Array with names
+ * @returns {Array} table of tables which contain incorrect listener (index 0) and exceptionName (index 1)
+ *
+ */
+function getListenerConversionExceptions(callbackNames) {
+    var result = [], conversionTable, i, j, listenerName;
+    conversionTable = getTypeConversionExceptions("functionObject", false);
+
+    for (i = 0; i < callbackNames.length; i++) {
+        for (j = 0; j < conversionTable.length; j++) {
+            listenerName = {};
+            listenerName[callbackNames[i]] = conversionTable[j][0];
+            result.push([listenerName, conversionTable[j][1]]);
+        }
+    }
+
+    return result;
+}
index 8061379fb4a23d02f33237e1dc22f7866268c430..aaed1d267163b9c08cc3013c3b9dce7e59ca06cc 100644 (file)
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="test whether the SEServiceManager object can have new attribute added" type="compliance" status="approved" component="TizenAPI/Communication/SE" execution_type="auto" priority="P3" id="SEService_extend">
+      <testcase purpose="Test whether the SEServiceManager object can have new attribute added" type="compliance" status="approved" component="TizenAPI/Communication/SE" execution_type="auto" priority="P3" id="SEService_extend">
         <description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_extend.html</test_script_entry>
         </description>
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="getReaders - check argument successCallback validation - use {onsuccess: function (){}}" type="compliance" onload_delay="90" status="approved" component="TizenAPI/Communication/SE" execution_type="auto" priority="P2" id="SEService_getReaders_successCallback_invalid_cb">
+      <testcase purpose="GetReaders - check argument successCallback validation - use {onsuccess: function (){}}" type="compliance" onload_delay="90" status="approved" component="TizenAPI/Communication/SE" execution_type="auto" priority="P2" id="SEService_getReaders_successCallback_invalid_cb">
         <description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_successCallback_invalid_cb.html</test_script_entry>
         </description>
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="check if registerSEListener of SEService throws exception when argument is incorrect" type="compliance" onload_delay="90" status="approved" component="TizenAPI/Communication/SE" execution_type="auto" priority="P2" id="SEService_registerSEListener_listener_TypeMismatch">
+      <testcase purpose="Check if registerSEListener of SEService throws exception when argument is incorrect" type="compliance" onload_delay="90" status="approved" component="TizenAPI/Communication/SE" execution_type="auto" priority="P2" id="SEService_registerSEListener_listener_TypeMismatch">
         <description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_listener_TypeMismatch.html</test_script_entry>
         </description>
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="check if registerSEListener of SEService throws exception when listener is invalid Check argument listener validation - use simple function" type="compliance" status="approved" component="TizenAPI/Communication/SE" execution_type="auto" priority="P2" id="SEService_registerSEListener_listener_invalid_cb">
+      <testcase purpose="Check if registerSEListener of SEService throws exception when listener is invalid" type="compliance" status="approved" component="TizenAPI/Communication/SE" execution_type="auto" priority="P2" id="SEService_registerSEListener_listener_invalid_cb">
         <description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_listener_invalid_cb.html</test_script_entry>
         </description>
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="getReaders - check argument errorCallback validation - use {onerror: function (){}}" type="compliance" onload_delay="90" status="approved" component="TizenAPI/Communication/SE" execution_type="auto" priority="P2" id="SEService_getReaders_errorCallback_invalid_cb">
+      <testcase purpose="GetReaders - check argument errorCallback validation - use {onerror: function (){}}" type="compliance" onload_delay="90" status="approved" component="TizenAPI/Communication/SE" execution_type="auto" priority="P2" id="SEService_getReaders_errorCallback_invalid_cb">
         <description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_errorCallback_invalid_cb.html</test_script_entry>
         </description>
index 05d1473e99c076ba51a08375cc10dff38de04f45..66d87604f269a0e28b95c76df47fe80da4815e35 100644 (file)
@@ -56,7 +56,7 @@
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/TransmitSuccessCallback_notexist.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="test whether the SEServiceManager object can have new attribute added" component="TizenAPI/Communication/SE" execution_type="auto" id="SEService_extend">
+      <testcase purpose="Test whether the SEServiceManager object can have new attribute added" component="TizenAPI/Communication/SE" execution_type="auto" id="SEService_extend">
         <description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_extend.html</test_script_entry>
         </description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_successCallback_TypeMismatch.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="getReaders - check argument successCallback validation - use {onsuccess: function (){}}" onload_delay="90" component="TizenAPI/Communication/SE" execution_type="auto" id="SEService_getReaders_successCallback_invalid_cb">
+      <testcase purpose="GetReaders - check argument successCallback validation - use {onsuccess: function (){}}" onload_delay="90" component="TizenAPI/Communication/SE" execution_type="auto" id="SEService_getReaders_successCallback_invalid_cb">
         <description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_successCallback_invalid_cb.html</test_script_entry>
         </description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_with_errorCallback.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="check if registerSEListener of SEService throws exception when argument is incorrect" onload_delay="90" component="TizenAPI/Communication/SE" execution_type="auto" id="SEService_registerSEListener_listener_TypeMismatch">
+      <testcase purpose="Check if registerSEListener of SEService throws exception when argument is incorrect" onload_delay="90" component="TizenAPI/Communication/SE" execution_type="auto" id="SEService_registerSEListener_listener_TypeMismatch">
         <description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_listener_TypeMismatch.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="check if registerSEListener of SEService throws exception when listener is invalid Check argument listener validation - use simple function" component="TizenAPI/Communication/SE" execution_type="auto" id="SEService_registerSEListener_listener_invalid_cb">
+      <testcase purpose="Check if registerSEListener of SEService throws exception when listener is invalid" component="TizenAPI/Communication/SE" execution_type="auto" id="SEService_registerSEListener_listener_invalid_cb">
         <description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_listener_invalid_cb.html</test_script_entry>
         </description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/ChannelSuccessCallback_notexist.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="getReaders - check argument errorCallback validation - use {onerror: function (){}}" onload_delay="90" component="TizenAPI/Communication/SE" execution_type="auto" id="SEService_getReaders_errorCallback_invalid_cb">
+      <testcase purpose="GetReaders - check argument errorCallback validation - use {onerror: function (){}}" onload_delay="90" component="TizenAPI/Communication/SE" execution_type="auto" id="SEService_getReaders_errorCallback_invalid_cb">
         <description>
           <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_errorCallback_invalid_cb.html</test_script_entry>
         </description>