[WebSetting] Various fixes.
authorTomasz Kusmierz <t.kusmierz@samsung.com>
Tue, 8 Oct 2013 10:24:11 +0000 (12:24 +0200)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Tue, 8 Oct 2013 11:16:42 +0000 (11:16 +0000)
Change-Id: I9735e3ec5f5392501831bd025238666a50ed192d

26 files changed:
tct-websetting-tizen-tests/resources/unitcommon.js [deleted file]
tct-websetting-tizen-tests/tests.full.xml
tct-websetting-tizen-tests/tests.xml
tct-websetting-tizen-tests/websetting/WebSettingManager_extend.html
tct-websetting-tizen-tests/websetting/WebSettingManager_in_tizen.html
tct-websetting-tizen-tests/websetting/WebSettingManager_notexist.html
tct-websetting-tizen-tests/websetting/WebSettingManager_removeAllCookies.html
tct-websetting-tizen-tests/websetting/WebSettingManager_removeAllCookies_errorCallback_TypeMismatch.html
tct-websetting-tizen-tests/websetting/WebSettingManager_removeAllCookies_errorCallback_invalid_cb.html
tct-websetting-tizen-tests/websetting/WebSettingManager_removeAllCookies_exist.html
tct-websetting-tizen-tests/websetting/WebSettingManager_removeAllCookies_nullableargs.html
tct-websetting-tizen-tests/websetting/WebSettingManager_removeAllCookies_successCallback_TypeMismatch.html
tct-websetting-tizen-tests/websetting/WebSettingManager_removeAllCookies_successCallback_invalid_cb.html
tct-websetting-tizen-tests/websetting/WebSettingManager_removeAllCookies_with_errorCallback.html
tct-websetting-tizen-tests/websetting/WebSettingManager_removeAllCookies_with_successCallback.html
tct-websetting-tizen-tests/websetting/WebSettingManager_setUserAgentString.html
tct-websetting-tizen-tests/websetting/WebSettingManager_setUserAgentString_errorCallback_TypeMismatch.html
tct-websetting-tizen-tests/websetting/WebSettingManager_setUserAgentString_errorCallback_invalid_cb.html
tct-websetting-tizen-tests/websetting/WebSettingManager_setUserAgentString_exist.html
tct-websetting-tizen-tests/websetting/WebSettingManager_setUserAgentString_nullableargs.html
tct-websetting-tizen-tests/websetting/WebSettingManager_setUserAgentString_successCallback_TypeMismatch.html
tct-websetting-tizen-tests/websetting/WebSettingManager_setUserAgentString_successCallback_invalid_cb.html
tct-websetting-tizen-tests/websetting/WebSettingManager_setUserAgentString_with_errorCallback.html
tct-websetting-tizen-tests/websetting/WebSettingManager_setUserAgentString_with_successCallback.html
tct-websetting-tizen-tests/websetting/WebSettingObject_notexist.html
tct-websetting-tizen-tests/websetting/support/unitcommon.js [new file with mode: 0644]

diff --git a/tct-websetting-tizen-tests/resources/unitcommon.js b/tct-websetting-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 e74c21dace00924dea7aa6e4c78b9d46380c0ed6..a463a3307367ed0c31c49ebf6d463cfef8e9b2da 100644 (file)
@@ -15,7 +15,7 @@
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="check if WebsettingManager exists in Tizen" type="compliance" status="approved" component="TizenAPI/System/WebSetting" execution_type="auto" priority="P3" id="WebSettingManager_in_tizen">
+      <testcase purpose="Check if WebsettingManager exists in Tizen" type="compliance" status="approved" component="TizenAPI/System/WebSetting" execution_type="auto" priority="P3" id="WebSettingManager_in_tizen">
         <description>
           <test_script_entry>/opt/tct-websetting-tizen-tests/websetting/WebSettingManager_in_tizen.html</test_script_entry>
         </description>
index 51c2e3cd689cdaadf18544fafcc383bc42ba22b6..dcb92391853f1c63e1cb048a5489940dcb53a5ea 100644 (file)
@@ -8,7 +8,7 @@
           <test_script_entry>/opt/tct-websetting-tizen-tests/websetting/WebSettingObject_notexist.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="check if WebsettingManager exists in Tizen" component="TizenAPI/System/WebSetting" execution_type="auto" id="WebSettingManager_in_tizen">
+      <testcase purpose="Check if WebsettingManager exists in Tizen" component="TizenAPI/System/WebSetting" execution_type="auto" id="WebSettingManager_in_tizen">
         <description>
           <test_script_entry>/opt/tct-websetting-tizen-tests/websetting/WebSettingManager_in_tizen.html</test_script_entry>
         </description>
index ded881abed047976d90451ae0d1daba0d5a69582..d80caef14508d70914f40132d302dc9f64936c32 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_extend</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,8 @@ Authors:
 
 test(function () {
     check_extensibility(tizen.websetting);
-}, "WebSettingManager_extend");
+}, document.title);
+
 </script>
 </body>
 </html>
index bdb86389052635f20a9a64a3611b7bc6613584a2..c284bf1fe99cd409384d6ca73c0c6399bc7c379b 100644 (file)
@@ -23,14 +23,14 @@ Authors:
 
 <head>
 <title>WebSettingManager_in_tizen</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
 <div id="log"></div>
 <script type="text/javascript">
 //==== TEST: WebSettingManager_in_tizen
-//==== LABEL check if WebsettingManager exists in Tizen
+//==== LABEL Check if WebsettingManager exists in Tizen
 //==== SPEC Tizen Web API:System:WebSetting:WebSettingManager:WebSettingManager U
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/websetting.html
 //==== PRIORITY P3
@@ -40,7 +40,8 @@ test(function () {
     assert_true("websetting" in tizen, "Tizen should implement WebSettingObject.");
     assert_equals(typeof(tizen.websetting), "object", "tizen.websetting should be object.");
     check_readonly(tizen, "websetting", tizen.websetting, "object", "dummyValue");
-}, "WebSettingManager_in_tizen");
+}, document.title);
+
 </script>
 </body>
 </html>
index 83616f677788d6ddf8a2216c60d47ead919853f2..72c0bce248aebbffba028a737714b2e1670d3107 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_notexist</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,8 @@ Authors:
 
 test(function () {
     check_no_interface_object("WebsettingManager");
-}, "WebSettingManager_notexist");
+}, document.title);
+
 </script>
 </body>
 </html>
index 3cace9755430aca790ed8a0bdb1755b058f323de..43f66c57d5f147978ecc9288db4e45b42a5fe09e 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_removeAllCookies</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MAST MOA MR
 
-var t = async_test("WebSettingManager_removdeAllCookies"),
+var t = async_test(document.title),
     successCallback, errorCallback, returnedValue = null;
 
 t.step(function () {
@@ -54,6 +54,7 @@ t.step(function () {
 
     returnedValue = tizen.websetting.removeAllCookies(successCallback, errorCallback);
 });
+
 </script>
 </body>
 </html>
index f0d0f08215cdd561dc8c807450f8788b52416174..8d5449071ad617d6fda04536296bb2ecdb3e10fd 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_removeAllCookies_errorCallback_TypeMismatch</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P2
 //==== TEST_CRITERIA MC
 
-var t = async_test("WebSettingManager_removeAllCookies_errorCallback_TypeMismatch"),
+var t = async_test(document.title),
     conversionTable, successCallback, errorCallback, exceptionName, i;
 
 t.step(function () {
@@ -56,6 +56,7 @@ t.step(function () {
     }
     t.done();
 });
+
 </script>
 </body>
 </html>
index 52e48130c45c08c388a03f08a6cc7785953d5299..78a662168d2af13984c40532bec8c2ba85958fda 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_removeAllCookies_errorCallback_invalid_cb</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P2
 //==== TEST_CRITERIA MTCB
 
-var t = async_test("WebSettingManager_removeAllCookies_errorCallback_invalid_cb"),
+var t = async_test(document.title),
     successCallback, invalidCallback, exceptionName = "TypeMismatchError";
 
 t.step(function () {
@@ -50,13 +50,14 @@ t.step(function () {
         })
     };
 
-    assert_throws({name : exceptionName},
+    assert_throws({name: exceptionName},
         function () {
             tizen.websetting.removeAllCookies(successCallback, invalidCallback);
         }, exceptionName + "should be thrown - given invalid error callback.");
 
     t.done();
 });
+
 </script>
 </body>
 </html>
index acbf605e809efe26892cc259afbea15a6ef35fbd..f8b4672adbc1ced52772a8c5ad4ea537bd33e6e8 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_removeAllCookies_exist</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,8 @@ Authors:
 
 test(function () {
     check_method_exists(tizen.websetting, "removeAllCookies");
-}, "WebSettingManager_removeAllCookies_exist");
+}, document.title);
+
 </script>
 </body>
 </html>
index 8736ef340c7b390d50aa9d50c8c872cb80a5f248..0636c20aa10401b5e89e53504838b20c98cb4eae 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_removeAllCookies_nullableargs</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -39,7 +39,8 @@ Authors:
 test(function () {
     var returnedValue = tizen.websetting.removeAllCookies(null, null);
     assert_equals(returnedValue, undefined, "Incorrect returned value.");
-},"WebSettingManager_removeAllCookies_nullableargs");
+}, document.title);
+
 </script>
 </body>
 </html>
index 033847ae5760463d4da1ddcd6e8ff69230689b22..62d440cc477e73a96a51b3dad1f29be0f30ca2fd 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_removeAllCookies_successCallback_TypeMismatch</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P2
 //==== TEST_CRITERIA MC
 
-var t = async_test("WebSettingManager_removeAllCookies_successCallback_TypeMismatch"),
+var t = async_test(document.title),
     conversionTable, successCallback, errorCallback, exceptionName, i;
 
 t.step(function () {
@@ -57,6 +57,7 @@ t.step(function () {
 
     t.done();
 });
+
 </script>
 </body>
 </html>
index 41bd01672219d05f5b1d1d12f1dd6f5172a83c34..a675b8da9d3f7d74a45b7ce614c8c22ecb3bb9af 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_removeAllCookies_successCallback_invalid_cb</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P2
 //==== TEST_CRITERIA MTCB
 
-var t = async_test("WebSettingManager_removeAllCookies_successCallback_invalid_cb"),
+var t = async_test(document.title),
     invalidCallback, errorCallback, exceptionName = "TypeMismatchError";
 
 t.step(function () {
@@ -51,13 +51,14 @@ t.step(function () {
         assert_unreached("error callback should not be invoked: name: " + error.name + ", msg: " + error.message);
     });
 
-    assert_throws({name : exceptionName},
+    assert_throws({name: exceptionName},
         function () {
             tizen.websetting.removeAllCookies(invalidCallback, errorCallback);
         }, exceptionName + "should be thrown - given invalid success callback.");
 
     t.done();
 });
+
 </script>
 </body>
 </html>
index 966c1cbdbfe7c2bae29012b67abaea0c317fa725..c423a2d5aa4c1813cc0b4a8029f004cb03fcf6da 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_removeAllCookies_with_errorCallback</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MOA MR
 
-var t = async_test("WebSettingManager_removeAllCookies_with_errorCallback"),
+var t = async_test(document.title),
     errorCallback, returnedValue = null;
 
 t.step(function () {
@@ -50,6 +50,7 @@ t.step(function () {
 
     t.done();
 });
+
 </script>
 </body>
 </html>
index 7cc9538d873b5ed5f9d0834f1cafe626666e403e..1ebdcd5eb9299bc15256e93cb3c4dee4752113d1 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_removeAllCookies_with_successCallback</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MOA MR MAST
 
-var t = async_test("WebSettingManager_removeAllCookies_with_successCallback"),
+var t = async_test(document.title),
     successCallback, returnedValue = null;
 
 t.step(function () {
@@ -50,6 +50,7 @@ t.step(function () {
 
     returnedValue = tizen.websetting.removeAllCookies(successCallback);
 });
+
 </script>
 </body>
 </html>
index f16e145296e39e79682b6fc068ce896d948a5f9b..0777504c45b9d6c09c5131b0afb78b70f00c7c30 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_setUserAgentString</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MMINA MAST MR
 
-var t = async_test("WebSettingManager_setUserAgentString"),
+var t = async_test(document.title),
     userAgent, successCallback, errorCallback, returnedValue = null;
 
 t.step(function () {
@@ -55,6 +55,7 @@ t.step(function () {
 
     returnedValue = tizen.websetting.setUserAgentString(userAgent, successCallback, errorCallback);
 });
+
 </script>
 </body>
 </html>
index a4704fd4f35bb2974857e8a9ccef979049e7de56..a78a54eedcdb12243422d9659a5df369b8e121f3 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_setUserAgentString_errorCallback_TypeMismatch</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P2
 //==== TEST_CRITERIA MC
 
-var t = async_test("WebSettingManager_setUserAgentString_errorCallback_TypeMismatch"),
+var t = async_test(document.title),
     userAgent, conversionTable, successCallback, errorCallback, exceptionName, i;
 
 t.step(function () {
@@ -60,6 +60,7 @@ t.step(function () {
 
     t.done();
 });
+
 </script>
 </body>
 </html>
index cebdc12aea1f70b40f45ad2517ef5ce551af0440..1a745f03b4d472b43c9a66861d6de235cd418c7f 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_setUserAgentString_errorCallback_invalid_cb</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P2
 //==== TEST_CRITERIA MTCB
 
-var t = async_test("WebSettingManager_setUserAgentString_errorCallback_invalid_cb"),
+var t = async_test(document.title),
     userAgent, successCallback, invalidCallback, exceptionName = "TypeMismatchError";
 
 t.step(function () {
@@ -53,13 +53,14 @@ t.step(function () {
 
     userAgent = "the new user agent string to set";
 
-    assert_throws({name : exceptionName},
+    assert_throws({name: exceptionName},
         function () {
             tizen.websetting.setUserAgentString(userAgent, successCallback, invalidCallback);
         }, exceptionName + "should be thrown - given invalid error callback.");
 
     t.done();
 });
+
 </script>
 </body>
 </html>
index 7a7405c51d62e8cb38d955da8f7a056d1cd3bd2b..24b8ebc2a9fa8ccc51db94a482934a9be4e482b1 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_setUserAgentString_exist</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,8 @@ Authors:
 
 test(function () {
     check_method_exists(tizen.websetting, "setUserAgentString");
-}, "WebSettingManager_setUserAgentString_exist");
+}, document.title);
+
 </script>
 </body>
 </html>
index 44f81a615314a5b858005901fa759399d49eda6a..d2af70430e0a5b94c667089555114698f52eba30 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_setUserAgentString_nullableargs</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -43,7 +43,7 @@ var userAgent = "Mozilla/5.0 (Linux; Tizen 2.2; TCT2.2) AppleWebKit/537.3" +
 test(function () {
     returnedValue = tizen.websetting.setUserAgentString(userAgent, null, null);
     assert_equals(returnedValue, undefined, "Incorrect returned value.");
-},"WebSettingManager_setUserAgentString_nullableargs");
+}, document.title);
 
 </script>
 </body>
index e0832f7fab4dc4358d275be9a818cfa32065c3c3..7c6c61894fe76f060acb1a698ae9152808c2cae9 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_setUserAgentString_successCallback_TypeMismatch</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P2
 //==== TEST_CRITERIA MC
 
-var t = async_test("WebSettingManager_setUserAgentString_successCallback_TypeMismatch"),
+var t = async_test(document.title),
     userAgent, conversionTable, successCallback, errorCallback, exceptionName, i;
 
 t.step(function () {
@@ -60,6 +60,7 @@ t.step(function () {
 
     t.done();
 });
+
 </script>
 </body>
 </html>
index 27b44b64d9d1825d552f9ef991fd0a7974fc641b..e9bb783b9be62be43e26740c86c593c6bc9ed3c5 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_setUserAgentString_successCallback_invalid_cb</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P2
 //==== TEST_CRITERIA MTCB
 
-var t = async_test("WebSettingManager_setUserAgentString_successCallback_invalid_cb"),
+var t = async_test(document.title),
     userAgent, invalidCallback, errorCallback, exceptionName = "TypeMismatchError";
 
 t.step(function () {
@@ -53,13 +53,14 @@ t.step(function () {
 
     userAgent = "the new user agent string to set";
 
-    assert_throws({name : exceptionName},
+    assert_throws({name: exceptionName},
         function () {
             tizen.websetting.setUserAgentString(userAgent, invalidCallback, errorCallback);
         }, exceptionName + "should be thrown - given invalid success callback.");
 
     t.done();
 });
+
 </script>
 </body>
 </html>
index 9560893c569b93e2a33d9fccd1405100e3eb23da..7c41723c89f96113a1e05ff9958f0cf289067ac0 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_setUserAgentString_with_errorCallback</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MOA MR
 
-var t = async_test("WebSettingManager_setUserAgentString_with_errorCallback"),
+var t = async_test(document.title),
     userAgent, errorCallback, returnedValue;
 
 t.step(function () {
@@ -52,6 +52,7 @@ t.step(function () {
 
     t.done();
 });
+
 </script>
 </body>
 </html>
index f873765e1ea0f0b5aebb96432dc1e568fa44d39e..f87d0423af18e96077c174a003fa0248660a2de2 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingManager_setUserAgentString_with_successCallback</title>
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -36,7 +36,7 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MOA MR MAST
 
-var t = async_test("WebSettingManager_setUserAgentString_with_successCallback"),
+var t = async_test(document.title),
     userAgent, successCallback, returnedValue = null;
 
 t.step(function () {
@@ -50,6 +50,7 @@ t.step(function () {
         "(KHTML, like Gecko) WebAPITizenWebsettingTests/2.2 Safari/APPLE_WEBKIT_VER";
     returnedValue = tizen.websetting.setUserAgentString(userAgent, successCallback);
 });
+
 </script>
 </body>
 </html>
index 4d81d943ed4308441ebbdb89da22b20a97d2ec11..084685dc89d0747c9cc00f35935d38cb56a7200d 100644 (file)
@@ -23,9 +23,7 @@ Authors:
 
 <head>
 <title>WebSettingObject_notexist</title>
-<script src="../resources/unitcommon.js"></script>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
+<script src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -40,7 +38,8 @@ Authors:
 
 test(function () {
     check_no_interface_object("WebSettingObject");
-}, "WebSettingObject_notexist");
+}, document.title);
+
 </script>
 </body>
 </html>
diff --git a/tct-websetting-tizen-tests/websetting/support/unitcommon.js b/tct-websetting-tizen-tests/websetting/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;
+}