+++ /dev/null
-/*
-
-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;
-}
</spec>
</specs>
</testcase>
- <testcase purpose="CompositeFilterType INTERSECTION" type="compliance" status="approved" component="TizenAPI/Tizen/Tizen" execution_type="auto" priority="P1" id="CompositeFilterType_enum_INTERSECTION">
+ <testcase purpose="Test CompositeFilterType with type INTERSECTION" type="compliance" status="approved" component="TizenAPI/Tizen/Tizen" execution_type="auto" priority="P1" id="CompositeFilterType_enum_INTERSECTION">
<description>
<test_script_entry>/opt/tct-tizen-tizen-tests/tizen/CompositeFilterType_enum_INTERSECTION.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="CompositeFilterType UNION" type="compliance" status="approved" component="TizenAPI/Tizen/Tizen" execution_type="auto" priority="P1" id="CompositeFilterType_enum_UNION">
+ <testcase purpose="Test CompositeFilterType with type UNION" type="compliance" status="approved" component="TizenAPI/Tizen/Tizen" execution_type="auto" priority="P1" id="CompositeFilterType_enum_UNION">
<description>
<test_script_entry>/opt/tct-tizen-tizen-tests/tizen/CompositeFilterType_enum_UNION.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-tizen-tizen-tests/tizen/AttributeRangeFilter_initialValue_attribute.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="CompositeFilterType INTERSECTION" component="TizenAPI/Tizen/Tizen" execution_type="auto" id="CompositeFilterType_enum_INTERSECTION">
+ <testcase purpose="Test CompositeFilterType with type INTERSECTION" component="TizenAPI/Tizen/Tizen" execution_type="auto" id="CompositeFilterType_enum_INTERSECTION">
<description>
<test_script_entry>/opt/tct-tizen-tizen-tests/tizen/CompositeFilterType_enum_INTERSECTION.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="CompositeFilterType UNION" component="TizenAPI/Tizen/Tizen" execution_type="auto" id="CompositeFilterType_enum_UNION">
+ <testcase purpose="Test CompositeFilterType with type UNION" component="TizenAPI/Tizen/Tizen" execution_type="auto" id="CompositeFilterType_enum_UNION">
<description>
<test_script_entry>/opt/tct-tizen-tizen-tests/tizen/CompositeFilterType_enum_UNION.html</test_script_entry>
</description>
<head>
<title>AbstractFilter_notexist</title>
<meta charset="utf-8">
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
//==== TEST_CRITERIA NIO
test(function () {
check_no_interface_object("AbstractFilter");
-}, "AbstractFilter_notexist");
+}, document.title);
</script>
</body>
<head>
<title>AttributeFilter_attributeName_attribute</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>
filter.attributeName = null;
assert_not_equals(filter.attributeName, null, "attributeName should not accept null");
-}, "AttributeFilter_attributeName_attribute");
+}, document.title);
</script>
</body>
<head>
<title>AttributeFilter_constructor</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>
"Constructor did not create AttributeFilter object.");
assert_equals(filter.attributeName, attrName,
"attributeName should be equal to constructor argument.");
-}, "AttributeFilter_constructor");
+}, document.title);
</script>
</body>
<head>
<title>AttributeFilter_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>
//==== TEST_CRITERIA CONSTRF
test(function () {
check_constructor("AttributeFilter");
-}, "AttributeFilter_exist");
+}, document.title);
</script>
</body>
<head>
<title>AttributeFilter_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>
filter = new tizen.AttributeFilter(attributeName, null, null);
check_extensibility(filter);
-}, "AttributeFilter_extend");
+}, document.title);
</script>
</body>
<head>
<title>AttributeFilter_matchFlag_attribute</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>
filter = new tizen.AttributeFilter("name.firstName");
assert_equals(filter.matchFlag, "EXACTLY", "matchFlag default value");
-}, "AttributeFilter_matchFlag_attribute");
+}, document.title);
</script>
</body>
<head>
<title>AttributeFilter_matchValue_attribute</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
filter = new tizen.AttributeFilter("name.firstName", "CONTAINS");
assert_equals(filter.matchValue, null, "matchValue default value");
-}, "AttributeFilter_matchValue_attribute");
+}, document.title);
</script>
</body>
<head>
<title>AttributeRangeFilter_attributeName_attribute</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>
filter.attributeName = null;
assert_not_equals(filter.attributeName, null, "attributeName should not accept null");
-}, "AttributeRangeFilter_attributeName_attribute");
+}, document.title);
</script>
</body>
<head>
<title>AttributeRangeFilter_constructor_min</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>
"Constructor did not create AttributeRangeFilter object.");
assert_equals(filter.attributeName, attributeName,
"attributeName is different from argument of cunstructor");
-}, "AttributeRangeFilter_constructor_min");
+}, document.title);
</script>
</body>
<head>
<title>AttributeRangeFilter_constructor_successful</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
assert_true(filter instanceof tizen.AttributeRangeFilter,
"Constructor did not create AttributeRangeFilter object.");
assert_equals(filter.attributeName, "startDate", "Check if attributeName equals to the value that is set when create AttributeRangeFilter");
-}, "AttributeRangeFilter_constructor_successful");
+}, document.title);
</script>
</body>
<head>
<title>AttributeRangeFilter_endValue_attribute</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
filter = new tizen.AttributeRangeFilter("startDate");
assert_equals(filter.endValue, null, "endValue default value");
-}, "AttributeRangeFilter_endValue_attribute");
+}, document.title);
</script>
</body>
<head>
<title>AttributeRangeFilter_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>
//==== TEST_CRITERIA CONSTRF
test(function () {
check_constructor("AttributeRangeFilter");
-}, "AttributeRangeFilter_exist");
+}, document.title);
</script>
</body>
<head>
<title>AttributeRangeFilter_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>
filter = new tizen.AttributeRangeFilter("startDate", 15, 85);
check_extensibility(filter);
-}, "AttributeRangeFilter_extend");
+}, document.title);
</script>
</body>
<head>
<title>AttributeRangeFilter_initialValue_attribute</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
filter = new tizen.AttributeRangeFilter("startDate");
assert_equals(filter.initialValue, null, "initialValue default value");
-}, "AttributeRangeFilter_initialValue_attribute");
+}, document.title);
</script>
</body>
<head>
<title>CompositeFilterType_enum_INTERSECTION</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: CompositeFilterType_enum_INTERSECTION
-//==== LABEL CompositeFilterType INTERSECTION
+//==== LABEL Test CompositeFilterType with type INTERSECTION
//==== PRIORITY P1
//==== SPEC Tizen Web API:Tizen:Tizen:CompositeFilter:constructor C
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/tizen.html
desc = "Create a Tizen CompositeFilter object with type " + type;
tizen_CompositeFilter_create(type, desc);
-}, "CompositeFilterType_enum_INTERSECTION");
+}, document.title);
</script>
</body>
<head>
<title>CompositeFilterType_enum_UNION</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: CompositeFilterType_enum_UNION
-//==== LABEL CompositeFilterType UNION
+//==== LABEL Test CompositeFilterType with type UNION
//==== PRIORITY P1
//==== SPEC Tizen Web API:Tizen:Tizen:CompositeFilter:constructor C
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/tizen.html
desc = "Create a Tizen CompositeFilter object with type " + type;
tizen_CompositeFilter_create(type, desc);
-}, "CompositeFilterType_enum_UNION");
+}, document.title);
</script>
</body>
<head>
<title>CompositeFilter_constructor</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>
assert_true(filter instanceof tizen.CompositeFilter,
"Constructor did not create CompositeFilter object.");
assert_equals(filter.type, type, "type should be equal to constructor argument.");
-}, "CompositeFilter_constructor");
+}, document.title);
</script>
</body>
<head>
<title>CompositeFilter_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>
//==== TEST_CRITERIA CONSTRF
test(function () {
check_constructor("CompositeFilter");
-}, "CompositeFilter_exist");
+}, document.title);
</script>
</body>
<head>
<title>CompositeFilter_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>
filter = new tizen.CompositeFilter(type, [firstNameFilter, lastNameFilter]);
check_extensibility(filter);
-}, "CompositeFilter_extend");
+}, document.title);
</script>
</body>
<head>
<title>CompositeFilter_filters_attribute</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
filter.filters = null;
assert_not_equals(filter.filters, null, "filter.filters should not accept null");
-}, "CompositeFilter_filters_attribute");
+}, document.title);
</script>
</body>
<head>
<title>CompositeFilter_type_attribute</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
filter.type = null;
assert_equals(filter.type, "UNION", "filter.type should ignore null assignment");
-}, "CompositeFilter_type_attribute");
+}, document.title);
</script>
</body>
<head>
<title>ErrorCallback_notexist</title>
<meta charset="utf-8">
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
//==== TEST_CRITERIA CBNIO
test(function () {
check_no_interface_object("ErrorCallback");
-}, "ErrorCallback_notexist");
+}, document.title);
</script>
</body>
<head>
<title>FilterMatchFlag_enum_CONTAINS</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
new tizen.AttributeFilter("name.firstName", matchFlag, "Chris");
-}, "FilterMatchFlag_enum_CONTAINS");
+}, document.title);
</script>
</body>
<head>
<title>FilterMatchFlag_enum_ENDSWITH</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
new tizen.AttributeFilter("name.firstName", matchFlag, "Chris");
-}, "FilterMatchFlag_enum_ENDSWITH");
+}, document.title);
</script>
</body>
<head>
<title>FilterMatchFlag_enum_EXACTLY</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
new tizen.AttributeFilter("name.firstName", matchFlag, "Chris");
-}, "FilterMatchFlag_enum_EXACTLY");
+}, document.title);
</script>
</body>
<head>
<title>FilterMatchFlag_enum_FULLSTRING</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
new tizen.AttributeFilter("name.firstName", matchFlag, "Chris");
-}, "FilterMatchFlag_enum_FULLSTRING");
+}, document.title);
</script>
</body>
<head>
<title>FilterMatchFlag_enum_STARTSWITH</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
new tizen.AttributeFilter("name.firstName", matchFlag, "Chris");
-}, "FilterMatchFlag_enum_STARTSWITH");
+}, document.title);
</script>
</body>
<head>
<title>FitlerMatchFlag_enum_EXISTS</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
new tizen.AttributeFilter("name.firstName", matchFlag, "Chris");
-}, "FitlerMatchingFlag_enum_EXISTS");
+}, document.title);
</script>
</body>
<head>
<title>SimpleCoordinates_constructor_successful</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
"Check if longitude equals to the value that is set when create SimpleCoordinates");
assert_not_equals(coordinates, null, "coordinates should not be null");
-}, "SimpleCoordinates_constructor_successful");
+}, document.title);
</script>
</body>
<head>
<title>SimpleCoordinates_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>
//==== TEST_CRITERIA CONSTRF
test(function () {
check_constructor("SimpleCoordinates");
-}, "SimpleCoordinates_exist");
+}, document.title);
</script>
</body>
<head>
<title>SimpleCoordinates_extend</title>
<meta charset="utf-8">
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
coordinates = new tizen.SimpleCoordinates(latitude, longitude);
check_extensibility(coordinates);
-}, "SimpleCoordinates_extend");
+}, document.title);
</script>
</body>
<head>
<title>SimpleCoordinates_latitude_attribute</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>
check_not_nullable(coordinates, "latitude");
-}, "SimpleCoordinates_latitude_attribute");
+}, document.title);
</script>
</body>
<head>
<title>SimpleCoordinates_longitude_attribute</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>
check_not_nullable(coordinates, "longitude");
-}, "SimpleCoordinates_longitude_attribute");
+}, document.title);
</script>
</body>
<head>
<title>SortModeOrder_enum_ASC</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
assert_equals(sortMode.order, order, "sortMode.order");
-}, "SortModeOrder_enum_ASC");
+}, document.title);
</script>
</body>
<head>
<title>SortModeOrder_enum_DESC</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
assert_equals(sortMode.order, order, "sortMode.order");
-}, "SortModeOrder_enum_DESC");
+}, document.title);
</script>
</body>
<head>
<title>SortMode_attributeName_attribute</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>
check_not_nullable(sortMode, "attributeName");
-}, "SortMode_attributeName_attribute");
+}, document.title);
</script>
</body>
<head>
<title>SortMode_constructor</title>
<meta charset="utf-8">
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
"Constructor did not create SortMode object.");
assert_equals(sortMode.attributeName, "name.firstName", "attributeName should be set");
assert_equals(order, sortMode.order, "order should be set");
-}, "SortMode_constructor");
+}, document.title);
</script>
</body>
<head>
<title>SortMode_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>
//==== TEST_CRITERIA CONSTRF
test(function () {
check_constructor("SortMode");
-}, "SortMode_exist");
+}, document.title);
</script>
</body>
<head>
<title>SortMode_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>
sortMode = new tizen.SortMode("name.firstName", order);
check_extensibility(sortMode);
-}, "SortMode_extend");
+}, document.title);
</script>
</body>
<head>
<title>SortMode_order_attribute</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>
sortMode = new tizen.SortMode("name.firstName");
assert_equals(sortMode.order, "ASC", "order default value");
-}, "SortMode_order_attribute");
+}, document.title);
</script>
</body>
<head>
<title>SuccessCallback_notexist</title>
<meta charset="utf-8">
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
//==== TEST_CRITERIA CBNIO
test(function () {
check_no_interface_object("SuccessCallback");
-}, "SuccessCallback_notexist");
+}, document.title);
</script>
</body>
<head>
<title>Tizen_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>
//==== TEST_CRITERIA OBX
test(function () {
check_extensibility(tizen);
-}, "Tizen_extend");
+}, document.title);
</script>
</body>
<head>
<title>Tizen_managerobject</title>
<meta charset="utf-8">
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
//==== TEST_CRITERIA
test(function () {
assert_exists(window, "tizen");
-}, "Tizen_managerobject");
+}, document.title);
</script>
</body>
<head>
<title>Tizen_notexist</title>
<meta charset="utf-8">
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
//==== TEST_CRITERIA NIO
test(function () {
check_no_interface_object("Tizen");
-}, "Tizen_notexist");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIError_code_attribute</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/tizen.html
//==== TEST_CRITERIA AE AT ARO
-var t = async_test("WebAPIError_code_attribute"), onAPIError;
+var t = async_test(document.title), onAPIError;
t.step(function () {
onAPIError = t.step_func(function (error) {
assert_true("code" in error, "No code attribute");
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIError_extend</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/tizen.html
//==== TEST_CRITERIA OBX
-var t = async_test("WebAPIError_extend"), onAPIError;
+var t = async_test(document.title), onAPIError;
t.step(function () {
onAPIError = t.step_func(function (error) {
check_extensibility(error);
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIError_message_attribute</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/tizen.html
//==== TEST_CRITERIA AE AT ARO
-var t = async_test("WebAPIError_message_attribute"), onAPIError, oldMessage;
+var t = async_test(document.title), onAPIError, oldMessage;
t.step(function () {
onAPIError = t.step_func(function (error) {
assert_true("message" in error, "No message attribute");
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIError_name_attribute</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/tizen.html
//==== TEST_CRITERIA AE AT ARO
-var t = async_test("WebAPIError_name_attribute"), onAPIError;
+var t = async_test(document.title), onAPIError;
t.step(function () {
onAPIError = t.step_func(function (error) {
assert_true("name" in error, "No name attribute");
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIError_notexist</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
//==== TEST_CRITERIA NIO
test(function () {
check_no_interface_object("WebAPIError");
-}, "WebAPIError_notexist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>WebAPIException_code_attribute</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
assert_true("code" in error, "No message attribute");
check_readonly(error, "code", DOM_CODE_NOT_FOUND_ERR, "unsigned short", 1);
-}, "WebAPIException_code_attribute");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_ABORT_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "ABORT_ERR", 20, "unsigned short", 1);
-}, "WebAPIException_const_ABORT_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_DATA_CLONE_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "DATA_CLONE_ERR", 25, "unsigned short", 1);
-}, "WebAPIException_const_DATA_CLONE_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_DOMSTRING_SIZE_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "DOMSTRING_SIZE_ERR", 2, "unsigned short", 1);
-}, "WebAPIException_const_DOMSTRING_SIZE_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_HIERARCHY_REQUEST_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "HIERARCHY_REQUEST_ERR", 3, "unsigned short", 1);
-}, "WebAPIException_const_HIERARCHY_REQUEST_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_INDEX_SIZE_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "INDEX_SIZE_ERR", 1, "unsigned short", 2);
-}, "WebAPIException_const_INDEX_SIZE_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_INUSE_ATTRIBUTE_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "INUSE_ATTRIBUTE_ERR", 10, "unsigned short", 1);
-}, "WebAPIException_const_INUSE_ATTRIBUTE_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_INVALID_ACCESS_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "INVALID_ACCESS_ERR", 15, "unsigned short", 1);
-}, "WebAPIException_const_INVALID_ACCESS_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_INVALID_CHARACTER_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "INVALID_CHARACTER_ERR", 5, "unsigned short", 1);
-}, "WebAPIException_const_INVALID_CHARACTER_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_INVALID_MODIFICATION_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "INVALID_MODIFICATION_ERR", 13, "unsigned short", 1);
-}, "WebAPIException_const_INVALID_MODIFICATION_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_INVALID_NODE_TYPE_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "INVALID_NODE_TYPE_ERR", 24, "unsigned short", 1);
-}, "WebAPIException_const_INVALID_NODE_TYPE_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_INVALID_STATE_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "INVALID_STATE_ERR", 11, "unsigned short", 1);
-}, "WebAPIException_const_INVALID_STATE_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_NAMESPACE_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "NAMESPACE_ERR", 14, "unsigned short", 1);
-}, "WebAPIException_const_NAMESPACE_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_NETWORK_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "NETWORK_ERR", 19, "unsigned short", 1);
-}, "WebAPIException_const_NETWORK_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_NOT_FOUND_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "NOT_FOUND_ERR", 8, "unsigned short", 1);
-}, "WebAPIException_const_NOT_FOUND_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_NOT_SUPPORTED_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "NOT_SUPPORTED_ERR", 9, "unsigned short", 1);
-}, "WebAPIException_const_NOT_SUPPORTED_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_NO_DATA_ALLOWED_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "NO_DATA_ALLOWED_ERR", 6, "unsigned short", 1);
-}, "WebAPIException_const_NO_DATA_ALLOWED_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_NO_MODIFICATION_ALLOWED_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "NO_MODIFICATION_ALLOWED_ERR", 7, "unsigned short", 1);
-}, "WebAPIException_const_NO_MODIFICATION_ALLOWED_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_QUOTA_EXCEEDED_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "QUOTA_EXCEEDED_ERR", 22, "unsigned short", 1);
-}, "WebAPIException_const_QUOTA_EXCEEDED_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_SECURITY_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "SECURITY_ERR", 18, "unsigned short", 1);
-}, "WebAPIException_const_SECURITY_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_SYNTAX_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "SYNTAX_ERR", 12, "unsigned short", 1);
-}, "WebAPIException_const_SYNTAX_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_TIMEOUT_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "TIMEOUT_ERR", 23, "unsigned short", 1);
-}, "WebAPIException_const_TIMEOUT_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_TYPE_MISMATCH_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "TYPE_MISMATCH_ERR", 17, "unsigned short", 1);
-}, "WebAPIException_const_TYPE_MISMATCH_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_URL_MISMATCH_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "URL_MISMATCH_ERR", 21, "unsigned short", 1);
-}, "WebAPIException_const_URL_MISMATCH_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_VALIDATION_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "VALIDATION_ERR", 16, "unsigned short", 1);
-}, "WebAPIException_const_VALIDATION_ERR");
+}, document.title);
</script>
</body>
Authors:
Han, JingX <jingx.han@intel.com>
- Lei,zhanx <zhanx.lei@intel.com>
+ Lei, zhanx <zhanx.lei@intel.com>
Karol Surma <k.surma@samsung.com>
-->
<html>
<head>
<title>WebAPIException_const_WRONG_DOCUMENT_ERR</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
test(function () {
var error = getWebAPIException();
check_const(error, "WRONG_DOCUMENT_ERR", 4, "unsigned short", 1);
-}, "WebAPIException_const_WRONG_DOCUMENT_ERR");
+}, document.title);
</script>
</body>
<html>
<head>
<title>WebAPIException_extend</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
var error = getWebAPIException();
check_extensibility(error);
-}, "WebAPIException_extend");
+}, document.title);
</script>
</body>
<html>
<head>
<title>WebAPIException_message_attribute</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
assert_true("message" in error, "No message attribute");
check_readonly(error, "message", error.message, "string", "Error occured");
assert_not_equals(error.message, "", "error.message");
-}, "WebAPIException_message_attribute");
+}, document.title);
</script>
</body>
<html>
<head>
<title>WebAPIException_name_attribute</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="support/tizen_tizen_tests.js"></script>
+<script src="support/unitcommon.js"></script>
+<script type="text/javascript" src="support/tizen_common.js"></script>
</head>
<body>
assert_true("name" in error, "No message attribute");
check_readonly(error, "name", "NotFoundError", "string", "SecurityError");
-}, "WebAPIException_name_attribute");
+}, document.title);
</script>
</body>
<head>
<title>WebAPIException_notexist</title>
<meta charset="utf-8">
-<script src="../resources/unitcommon.js"></script>
+<script src="support/unitcommon.js"></script>
</head>
<body>
//==== TEST_CRITERIA NIO
test(function () {
check_no_interface_object("WebAPIException");
-}, "WebAPIException_notexist");
+}, document.title);
</script>
</body>
--- /dev/null
+
+/*
+Copyright (c) 2012 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+ of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+ may be used to endorse or promote products derived from this work without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+ Huajun Li <huajun.li@intel.com>
+ Wang, ChaoX <chaox.wang@intel.com>
+ Lukasz Bardeli <l.bardeli@samsung.com>
+
+*/
+
+
+var apiTest = {
+ wac : {
+ orgName : "WAC2.0"
+ },
+
+ w3c : {
+ orgName : "W3C"
+ },
+
+ tizen : {
+ orgName : "TIZEN"
+ }
+};
+
+var TYPE_MISMATCH_ERR = "TypeMismatchError";
+var INVALID_VALUES_ERR = "InvalidValuesError";
+var NOT_FOUND_ERR = "NotFoundError";
+var UNKNOWN_ERR = "UnknownError";
+var NOT_SUPPORTED_ERR = "NotSupportedError";
+var PERMISSION_DENIED_ERR = "SecurityError";
+
+var DOM_CODE_NOT_FOUND_ERR = 8;
+
+function tizen_CompositeFilter_create(type, desc) {
+ // Create an attribute filter based on first name: "First name should contain 'Chris' (case insensitive)
+ var firstNameFilter = new tizen.AttributeFilter("name.firstName", "CONTAINS", "Chris");
+ // Create an attribute filter based on last name: "Last name should be exactly 'Smith' (case insensitive)
+ var lastNameFilter = new tizen.AttributeFilter("name.lastName", "EXACTLY", "Smith");
+ // Create a filter based on the intersection of these two filter:
+ // "First name should contain 'Chris' AND last name should be 'Smith'".
+ var filter;
+
+ try {
+ return new tizen.CompositeFilter(type, [firstNameFilter, lastNameFilter]);
+ } catch (e) {
+ assert_false(true, "Fail to " + desc);
+ }
+}
+
+function getWebAPIException(kind) {
+ try {
+ if (kind === "NotFoundError") {
+ tizen.application.getAppInfo("111AppID88.WhichWillNotBeFound");
+ } else {
+ tizen.application.findAppControl();
+ }
+ } catch(error) {
+ return error;
+ }
+ assert_unreached("Expected exception was not thrown. Can\'t continue.");
+}
+
+function getWebAPIError(test_obj, callback, kind) {
+ var killSuccess, killError, currentApplication;
+ assert_not_equals(callback, undefined, "callback is required argument of getWebAPIException()");
+ onSuccess = test_obj.step_func(function () {
+ assert_unreached("successCallback should not be called");
+ });
+ onError = test_obj.step_func(function (error) {
+ callback(error);
+ });
+
+ currentApplication = tizen.application.getCurrentApplication();
+ if (kind === "NotFoundError") {
+ tizen.application.launchAppControl(
+ new tizen.ApplicationControl("WRONG_NOT_IMPLEMENTED_OPERATION"),
+ "111AppID88.WhichWillNotBeFound",
+ onSuccess, onError
+ );
+ } else {
+ assert_equals(kind, undefined, "Fix the test. Requested kind of error is not available");
+ tizen.application.kill(currentApplication.contextId, onSuccess, onError);
+ }
+}
+++ /dev/null
-
-/*
-Copyright (c) 2012 Intel Corporation.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-* Redistributions of works must retain the original copyright notice, this list
- of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the original copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-* Neither the name of Intel Corporation nor the names of its contributors
- may be used to endorse or promote products derived from this work without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Authors:
- Huajun Li <huajun.li@intel.com>
- Wang, ChaoX <chaox.wang@intel.com>
- Lukasz Bardeli <l.bardeli@samsung.com>
-
-*/
-
-
-var apiTest = {
- wac : {
- orgName : "WAC2.0"
- },
-
- w3c : {
- orgName : "W3C"
- },
-
- tizen : {
- orgName : "TIZEN"
- }
-};
-
-var TYPE_MISMATCH_ERR = "TypeMismatchError";
-var INVALID_VALUES_ERR = "InvalidValuesError";
-var NOT_FOUND_ERR = "NotFoundError";
-var UNKNOWN_ERR = "UnknownError";
-var NOT_SUPPORTED_ERR = "NotSupportedError";
-var PERMISSION_DENIED_ERR = "SecurityError";
-
-var DOM_CODE_NOT_FOUND_ERR = 8;
-
-function tizen_CompositeFilter_create(type, desc) {
- // Create an attribute filter based on first name: "First name should contain 'Chris' (case insensitive)
- var firstNameFilter = new tizen.AttributeFilter("name.firstName", "CONTAINS", "Chris");
- // Create an attribute filter based on last name: "Last name should be exactly 'Smith' (case insensitive)
- var lastNameFilter = new tizen.AttributeFilter("name.lastName", "EXACTLY", "Smith");
- // Create a filter based on the intersection of these two filter:
- // "First name should contain 'Chris' AND last name should be 'Smith'".
- var filter;
-
- try {
- return new tizen.CompositeFilter(type, [firstNameFilter, lastNameFilter]);
- } catch (e) {
- assert_false(true, "Fail to " + desc);
- }
-}
-
-function getWebAPIException(kind) {
- try {
- if (kind === "NotFoundError") {
- tizen.application.getAppInfo("111AppID88.WhichWillNotBeFound");
- } else {
- tizen.application.findAppControl();
- }
- } catch(error) {
- return error;
- }
- assert_unreached("Expected exception was not thrown. Can\'t continue.");
-}
-
-function getWebAPIError(test_obj, callback, kind) {
- var killSuccess, killError, currentApplication;
- assert_not_equals(callback, undefined, "callback is required argument of getWebAPIException()");
- onSuccess = test_obj.step_func(function () {
- assert_unreached("successCallback should not be called");
- });
- onError = test_obj.step_func(function (error) {
- callback(error);
- });
-
- currentApplication = tizen.application.getCurrentApplication();
- if (kind === "NotFoundError") {
- tizen.application.launchAppControl(
- new tizen.ApplicationControl("WRONG_NOT_IMPLEMENTED_OPERATION"),
- "111AppID88.WhichWillNotBeFound",
- onSuccess, onError
- );
- } else {
- assert_equals(kind, undefined, "Fix the test. Requested kind of error is not available");
- tizen.application.kill(currentApplication.contextId, onSuccess, onError);
- }
-}
--- /dev/null
+/*
+
+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;
+}