<head>
<title>PackageInformationArraySuccessCallback_notexist</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA CBNIO
test(function () {
check_no_interface_object("PackageInformationArraySuccessCallback");
-}, "PackageInformationArraySuccessCallback_notexist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>PackageInformationArraySuccessCallback_onsuccess</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA CBT CBOA
setup({timeout: 30000});
-var t = async_test("PackageInformationArraySuccessCallback_onsuccess", {timeout: 30000}), packageInformation,
+var t = async_test(document.title, {timeout: 30000}), packageInformation,
packageInformationArraySuccessCallback, errorCallback;
t.step(function () {
<head>
<title>PackageInformationEventCallback_notexist</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA CBNIO
test(function () {
check_no_interface_object("PackageInformationEventCallback");
-}, "PackageInformationEventCallback_notexist");
+}, document.title);
</script>
</body>
<head>
<title>PackageInformationEventCallback_oninstalled</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
setup({timeout: 90000});
var packageInformationEventCallback,
- t = async_test("PackageInformationEventCallback_oninstalled", {timeout: 90000});
+ t = async_test(document.title, {timeout: 90000});
t.step(function () {
packageInformationEventCallback = {
<head>
<title>PackageInformationEventCallback_onuninstalled</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
setup({timeout: 90000});
var packageInformationEventCallback,
- t = async_test("PackageInformationEventCallback_onuninstalled", {timeout: 90000});
+ t = async_test(document.title, {timeout: 90000});
t.step(function () {
packageInformationEventCallback = {
<head>
<title>PackageInformationEventCallback_onupdated</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
setup({timeout: 90000});
var packageInformationEventCallback,
- t = async_test("PackageInformationEventCallback_onupdated", {timeout: 90000});
+ t = async_test(document.title, {timeout: 90000});
t.step(function () {
packageInformationEventCallback = {
<head>
<title>PackageInformation_appIds_attribute</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
packageInformation.appIds = null;
assert_array_equals(packageInformation.appIds, expectedValue, "PackageInformation.appIds is incorrect.");
-}, "PackageInformation_appIds_attribute");
+}, document.title);
</script>
</body>
<head>
<title>PackageInformation_author_attribute</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
var packageInformation = tizen.package.getPackageInfo(TCT_PACKAGE_INFO_TEST_PACKAGE_ID);
assert_own_property(packageInformation, "author" , "PackageInformation does not own author property.");
check_readonly(packageInformation, "author", TCT_PACKAGE_INFO_TEST_PACKAGE_AUTHOR, "string", "newValue");
-}, "PackageInformation_author_attribute");
+}, document.title);
</script>
</body>
<head>
<title>PackageInformation_dataSize_attribute</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
assert_type(packageInformation.dataSize, "long", "Incorrect type for PackageInformation.dataSize after assignment.");
assert_not_equals(packageInformation.dataSize, null, "PackageInformation.dataSize can be modified.");
assert_equals(packageInformation.dataSize, originalValue, "PackageInformation.dataSize can be modified.");
-}, "PackageInformation_dataSize_attribute");
+}, document.title);
</script>
</body>
<head>
<title>PackageInformation_description_attribute</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
var packageInformation = tizen.package.getPackageInfo(TCT_PACKAGE_INFO_TEST_PACKAGE_ID);
assert_own_property(packageInformation, "description" , "PackageInformation does not own description property.");
check_readonly(packageInformation, "description", TCT_PACKAGE_INFO_TEST_PACKAGE_DESCRIPTION, "string", "newValue");
-}, "PackageInformation_description_attribute");
+}, document.title);
</script>
</body>
<html>
<head>
<title>PackageInformation_extend</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: PackageInformation_extend
-//==== LABEL check if PackageInformation is extendable
+//==== LABEL Check if PackageInformation is extendable
//==== SPEC Tizen Web API:Application:Package:PackageInformation:PackageInformation U
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/package.html
//==== PRIORITY P3
test(function () {
var packageInformation = tizen.package.getPackageInfo();
check_extensibility(packageInformation);
-}, "PackageInformation_extend");
+}, document.title);
</script>
</body>
<head>
<title>PackageInformation_iconPath_attribute</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
assert_not_equals(packageInformation.iconPath, null, "PackageInformation.iconPath can be modified.");
assert_equals(packageInformation.iconPath, originalValue, "PackageInformation.iconPath can be modified.");
-}, "PackageInformation_iconPath_attribute");
+}, document.title);
</script>
</body>
<head>
<title>PackageInformation_id_attribute</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
var packageInformation = tizen.package.getPackageInfo(TCT_PACKAGE_INFO_TEST_PACKAGE_ID);
assert_own_property(packageInformation, "id" , "PackageInformation does not own id property.");
check_readonly(packageInformation, "id", TCT_PACKAGE_INFO_TEST_PACKAGE_ID, "string", "newValue");
-}, "PackageInformation_id_attribute");
+}, document.title);
</script>
</body>
<head>
<title>PackageInformation_lastModified_attribute</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
assert_not_equals(packageInformation.lastModified, null, "PackageInformation.lastModified can be modified.");
assert_equals(packageInformation.lastModified.getTime(), originalValue.getTime(), "PackageInformation.lastModified can be modified.");
-}, "PackageInformation_lastModified_attribute");
+}, document.title);
</script>
</body>
<head>
<title>PackageInformation_name_attribute</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
var packageInformation = tizen.package.getPackageInfo(TCT_PACKAGE_INFO_TEST_PACKAGE_ID);
assert_own_property(packageInformation, "name" , "PackageInformation does not own name property.");
check_readonly(packageInformation, "name", TCT_PACKAGE_INFO_TEST_PACKAGE_NAME, "string", "newValue");
-}, "PackageInformation_name_attribute");
+}, document.title);
</script>
</body>
<head>
<title>PackageInformation_notexist</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA NIO
test(function () {
check_no_interface_object("PackageInformation");
-}, "PackageInformation_notexist");
+}, document.title);
</script>
</body>
<head>
<title>PackageInformation_totalSize_attribute</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
assert_type(packageInformation.totalSize, "long", "Incorrect type for PackageInformation.totalSize after assignment.");
assert_not_equals(packageInformation.totalSize, null, "PackageInformation.totalSize can be modified.");
assert_equals(packageInformation.totalSize, originalValue, "PackageInformation.totalSize can be modified.");
-}, "PackageInformation_totalSize_attribute");
+}, document.title);
</script>
</body>
<head>
<title>PackageInformation_version_attribute</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
var packageInformation = tizen.package.getPackageInfo(TCT_PACKAGE_INFO_TEST_PACKAGE_ID);
assert_own_property(packageInformation, "version" , "PackageInformation does not own version property.");
check_readonly(packageInformation, "version", TCT_PACKAGE_INFO_TEST_PACKAGE_VERSION, "string", "newValue");
-}, "PackageInformation_version_attribute");
+}, document.title);
</script>
</body>
<head>
<title>PackageManagerObject_notexist</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA NIO
test(function () {
check_no_interface_object("PackageManagerObject");
-}, "PackageManagerObject_notexist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>PackageManager_extend</title>
-<script src="../resources/unitcommon.js"></script>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
<div id="log"></div>
<script type="text/javascript">
//==== TEST: PackageManager_extend
-//==== LABEL check if PackageManager is extendable
+//==== LABEL Check if PackageManager is extendable
//==== SPEC Tizen Web API:Application:Package:PackageManager:PackageManager U
//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/package.html
//==== PRIORITY P3
//==== TEST_CRITERIA OBX
test(function () {
check_extensibility(tizen.package);
-}, "PackageManager_extend");
+}, document.title);
</script>
</body>
<head>
<title>PackageManager_getPackageInfo</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
assert_equals(packageInformation.description, TCT_PACKAGE_TIZEN_TESTS_PACKAGE_DESCRIPTION,
"PackageInformation.description is incorect.");
-}, "PackageManager_getPackageInfo");
+}, document.title);
</script>
</body>
<head>
<title>PackageManager_getPackageInfo_exist</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
test(function () {
assert_true("getPackageInfo" in tizen.package, "No getPackageInfo method in tizen.package");
check_method_exists(tizen.package, "getPackageInfo");
-}, "PackageManager_getPackageInfo_exist");
+}, document.title);
</script>
</body>
<head>
<title>PackageManager_getPackageInfo_with_id</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
assert_equals(packageInformation.description, TCT_PACKAGE_INFO_TEST_PACKAGE_DESCRIPTION,
"PackageInformation.description is incorect.");
-}, "PackageManager_getPackageInfo_with_id");
+}, document.title);
</script>
</body>
<html>
<head>
<title>PackageManager_getPackagesInfo</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MMINA MR
setup({timeout: 90000});
-var t = async_test("PackageManager_getPackagesInfo", {timeout: 90000}),
+var t = async_test(document.title, {timeout: 90000}),
packageInformationArraySuccessCallback, returnedValue = null;
t.step(function () {
<html>
<head>
<title>PackageManager_getPackagesInfo_errorCallback_TypeMismatch</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MC
setup({timeout: 30000});
-var t = async_test("PackageManager_getPackagesInfo_errorCallback_TypeMismatch", {timeout: 30000}), conversionTable,
+var t = async_test(document.title, {timeout: 30000}), conversionTable,
packageInformationArraySuccessCallback, exceptionName, errorCallback, i;
t.step(function () {
errorCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.getPackagesInfo(packageInformationArraySuccessCallback, errorCallback);
}, exceptionName + " should be thrown - given incorrect errorCallback: " + errorCallback + ".");
<html>
<head>
<title>PackageManager_getPackagesInfo_errorCallback_invalid_cb</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MTCB
setup({timeout: 30000});
-var t = async_test("PackageManager_getPackagesInfo_errorCallback_invalid_cb", {timeout: 30000}), exceptionName = "TypeMismatchError",
+var t = async_test(document.title, {timeout: 30000}), exceptionName = "TypeMismatchError",
invalidCallback, packageInformationArraySuccessCallback;
t.step(function () {
})
};
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.getPackagesInfo(packageInformationArraySuccessCallback, invalidCallback);
}, exceptionName + " should be thrown - given incorrect error callback - object.");
<head>
<title>PackageManager_getPackagesInfo_exist</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
test(function () {
assert_true("getPackagesInfo" in tizen.package, "No getPackagesInfo method in tizen.package");
check_method_exists(tizen.package, "getPackagesInfo");
-}, "PackageManager_getPackagesInfo_exist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>PackageManager_getPackagesInfo_missarg</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MMA
setup({timeout: 30000});
-var t = async_test("PackageManager_getPackagesInfo_missarg", {timeout: 30000}),
+var t = async_test(document.title, {timeout: 30000}),
exceptionName = "TypeMismatchError";
t.step(function () {
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.getPackagesInfo();
}, exceptionName + " should be thrown - missing successCallback.");
<html>
<head>
<title>PackageManager_getPackagesInfo_successCallback_TypeMismatch</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
<body>
//==== TEST_CRITERIA MC
setup({timeout: 30000});
-var t = async_test("PackageManager_getPackagesInfo_successCallback_TypeMismatch", {timeout: 30000}), conversionTable,
+var t = async_test(document.title, {timeout: 30000}), conversionTable,
packageInformationArraySuccessCallback, exceptionName, errorCallback, i;
t.step(function () {
packageInformationArraySuccessCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.getPackagesInfo(packageInformationArraySuccessCallback, errorCallback);
}, exceptionName + " should be thrown - given incorrect successCallback: " + packageInformationArraySuccessCallback + ".");
<html>
<head>
<title>PackageManager_getPackagesInfo_successCallback_invalid_cb</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
<body>
//==== TEST_CRITERIA MTCB
setup({timeout: 30000});
-var t = async_test("PackageManager_getPackagesInfo_successCallback_invalid_cb", {timeout: 30000}), exceptionName = "TypeMismatchError",
+var t = async_test(document.title, {timeout: 30000}), exceptionName = "TypeMismatchError",
errorCallback, invalidCallback;
t.step(function () {
assert_unreached("ErrorCallback invoked: " + error.name + ": " + error.message);
});
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.getPackagesInfo(invalidCallback, errorCallback);
}, exceptionName + " should be thrown - given incorrect successCallback - object.");
<html>
<head>
<title>PackageManager_getPackagesInfo_with_errorCallback</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MOA
setup({timeout: 90000});
-var t = async_test("PackageManager_getPackagesInfo_with_errorCallback", {timeout: 90000}),
+var t = async_test(document.title, {timeout: 90000}),
packageInformationArraySuccessCallback, errorCallback;
t.step(function () {
<head>
<title>PackageManager_in_tizen</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
test(function () {
assert_true("package" in tizen, "No package in tizen.");
check_readonly(tizen, "package", tizen.package, "object", "dummyValue");
-}, "PackageManager_in_tizen");
+}, document.title);
</script>
</body>
<head>
<title>PackageManager_install</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MOA MR MAST
setup({timeout: 90000});
-var t = async_test("PackageManager_install", {timeout: 90000}), wasInProgress = false, installProgressCallback, installError,
+var t = async_test(document.title, {timeout: 90000}), wasInProgress = false, installProgressCallback, installError,
returnedValue = null, packageInformation;
t.step(function () {
<head>
<title>PackageManager_install_errorCallback_TypeMismatch</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MC
setup({timeout: 30000});
-var t = async_test("PackageManager_install_errorCallback_TypeMismatch", {timeout: 30000}), exceptionName,
+var t = async_test(document.title, {timeout: 30000}), exceptionName,
incorrectCallback, installProgressCallback, conversionTable, i;
t.step(function () {
assert_unreached("onprogress invoked.");
}),
oncomplete: t.step_func(function (packageId) {
- assert_unreached("oncomplete invoked,");
+ assert_unreached("oncomplete invoked, ");
})
};
incorrectCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.install(TCT_PACKAGE_MANAGER_TEST_PACKAGE_PATH, installProgressCallback, incorrectCallback);
}, exceptionName + " should be thrown - given incorrect errorCallback: " + incorrectCallback + ".");
<head>
<title>PackageManager_install_errorCallback_invalid_cb</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MTCB
setup({timeout: 30000});
-var t = async_test("PackageManager_install_errorCallback_invalid_cb", {timeout: 30000}), exceptionName = "TypeMismatchError",
+var t = async_test(document.title, {timeout: 30000}), exceptionName = "TypeMismatchError",
invalidCallback, installProgressCallback;
t.step(function () {
assert_unreached("onprogress invoked.");
}),
oncomplete: t.step_func(function (packageId) {
- assert_unreached("oncomplete invoked,");
+ assert_unreached("oncomplete invoked, ");
})
};
})
};
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.install(TCT_PACKAGE_MANAGER_TEST_PACKAGE_PATH, installProgressCallback, invalidCallback);
}, exceptionName + " should be thrown - given incorrect errorCallback - object.");
<head>
<title>PackageManager_install_errorCallback_invoked</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MERRCB
setup({timeout: 30000});
-var t = async_test("PackageManager_install_errorCallback_invoked", {timeout: 30000}), installProgressCallback, installError;
+var t = async_test(document.title, {timeout: 30000}), installProgressCallback, installError;
t.step(function () {
installProgressCallback = {
<head>
<title>PackageManager_install_exist</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
test(function () {
assert_true("install" in tizen.package, "No install method in tizen.package");
check_method_exists(tizen.package, "install");
-}, "PackageManager_install_exist");
+}, document.title);
</script>
</body>
<head>
<title>PackageManager_install_missarg</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MMA
test(function () {
var exceptionName = "TypeMismatchError";
- assert_throws({name : exceptionName}, function () {
+ assert_throws({name: exceptionName}, function () {
tizen.package.install(TCT_PACKAGE_MANAGER_TEST_PACKAGE_PATH);
}, exceptionName + " should be thrown - missing argument.");
-}, "PackageManager_install_missarg");
+}, document.title);
</script>
</body>
<head>
<title>PackageManager_install_progressCallback_TypeMismatch</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MC
setup({timeout: 30000});
-var t = async_test("PackageManager_install_progressCallback_TypeMismatch", {timeout: 30000}), installProgressCallback, installError,
+var t = async_test(document.title, {timeout: 30000}), installProgressCallback, installError,
exceptionName, i, conversionTable;
t.step(function () {
installProgressCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.install(TCT_PACKAGE_MANAGER_TEST_PACKAGE_PATH, installProgressCallback, installError);
}, exceptionName + " should be thrown - given incorrect listener: " + installProgressCallback + ".");
<head>
<title>PackageManager_install_progressCallback_invalid_cb</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MTL
setup({timeout: 30000});
-var t = async_test("PackageManager_install_progressCallback_invalid_cb", {timeout: 30000}), exceptionName,
+var t = async_test(document.title, {timeout: 30000}), exceptionName,
incorrectListeners, i, installError, installProgressCallback;
t.step(function () {
for(i = 0; i < incorrectListeners.length; i++) {
installProgressCallback = incorrectListeners[i][0];
exceptionName = incorrectListeners[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.install(TCT_PACKAGE_MANAGER_TEST_PACKAGE_PATH, installProgressCallback, installError);
}, exceptionName + " should be thrown - given incorrect listener.");
<head>
<title>PackageManager_install_without_errorCallback</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MMINA MR MAST
setup({timeout: 90000});
-var t = async_test("PackageManager_install_without_errorCallback", {timeout: 90000}), wasInProgress = false, installProgressCallback,
+var t = async_test(document.title, {timeout: 90000}), wasInProgress = false, installProgressCallback,
returnedValue = null, packageInformation;
t.step(function () {
<head>
<title>PackageManager_notexist</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA NIO
test(function () {
check_no_interface_object("PackageManager");
-}, "PackageManager_notexist");
+}, document.title);
</script>
</body>
<head>
<title>PackageManager_setPackageInfoEventListener</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
} finally {
tizen.package.unsetPackageInfoEventListener();
}
-}, "PackageManager_setPackageInfoEventListener");
+}, document.title);
</script>
</body>
<html>
<head>
<title>PackageManager_setPackageInfoEventListener_eventCallback_TypeMismatch</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MC
setup({timeout: 30000});
-var t = async_test("PackageManager_setPackageInfoEventListener_eventCallback_TypeMismatch", {timeout: 30000}), conversionTable,
+var t = async_test(document.title, {timeout: 30000}), conversionTable,
packageInformationEventCallback, exceptionName, i;
t.step(function () {
packageInformationEventCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.setPackageInfoEventListener(packageInformationEventCallback);
}, exceptionName + " should be thrown - given incorrect listener: " + packageInformationEventCallback + ".");
<html>
<head>
<title>PackageManager_setPackageInfoEventListener_eventCallback_invalid_cb</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MTL
setup({timeout: 30000});
-var t = async_test("PackageManager_setPackageInfoEventListener_eventCallback_invalid_cb", {timeout: 30000}), exceptionName,
+var t = async_test(document.title, {timeout: 30000}), exceptionName,
incorrectListeners, i, packageInformationEventCallback;
t.step(function () {
for(i = 0; i < incorrectListeners.length; i++) {
packageInformationEventCallback = incorrectListeners[i][0];
exceptionName = incorrectListeners[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.setPackageInfoEventListener(packageInformationEventCallback);
}, exceptionName + " should be thrown - given incorrect successCallback.");
<head>
<title>PackageManager_setPackageInfoEventListener_exist</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
test(function () {
assert_true("setPackageInfoEventListener" in tizen.package, "No setPackageInfoEventListener method in tizen.package");
check_method_exists(tizen.package, "setPackageInfoEventListener");
-}, "PackageManager_setPackageInfoEventListener_exist");
+}, document.title);
</script>
</body>
<html>
<head>
<title>PackageManager_setPackageInfoEventListener_misarg</title>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
test(function () {
var exceptionName = "TypeMismatchError";
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.setPackageInfoEventListener();
}, exceptionName + " should be thrown - not given any argument.");
-}, "PackageManager_setPackageInfoEventListener_misarg");
+}, document.title);
</script>
</body>
<head>
<title>PackageManager_uninstall</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MOA MR MAST
setup({timeout: 90000});
-var t = async_test("PackageManager_uninstall", {timeout: 90000}), wasInProgress = false,
+var t = async_test(document.title, {timeout: 90000}), wasInProgress = false,
uninstallProgressCallback, uninstallError, returnedValue = null;
t.step(function () {
assert_true(wasInProgress, "onprogress callback was not invoked.");
assert_equals(packageId, TCT_PACKAGE_MANAGER_TEST_PACKAGE_ID, "Incorrect packageId.");
- assert_throws({name : "NotFoundError"},
+ assert_throws(NOT_FOUND_EXCEPTION,
function () {
tizen.package.getPackageInfo(TCT_PACKAGE_MANAGER_TEST_PACKAGE_ID);
}, "Package is still installed.");
<head>
<title>PackageManager_uninstall_errorCallback_TypeMismatch</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MC
setup({timeout: 30000});
-var t = async_test("PackageManager_uninstall_errorCallback_TypeMismatch", {timeout: 30000}),
+var t = async_test(document.title, {timeout: 30000}),
exceptionName, incorrectCallback, uninstallProgressCallback, conversionTable, i;
t.step(function () {
assert_unreached("onprogress invoked.");
}),
oncomplete: t.step_func(function (packageId) {
- assert_unreached("oncomplete invoked,");
+ assert_unreached("oncomplete invoked, ");
})
};
incorrectCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.uninstall(TCT_PACKAGE_MANAGER_TEST_PACKAGE_PATH, uninstallProgressCallback, incorrectCallback);
}, exceptionName + " should be thrown - given incorrect errorCallback: " + incorrectCallback + ".");
<head>
<title>PackageManager_uninstall_errorCallback_invalid_cb</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MTCB
setup({timeout: 30000});
-var t = async_test("PackageManager_uninstall_errorCallback_invalid_cb", {timeout: 30000}),
+var t = async_test(document.title, {timeout: 30000}),
exceptionName = "TypeMismatchError", invalidCallback, uninstallProgressCallback;
t.step(function () {
})
};
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.uninstall(TCT_PACKAGE_MANAGER_TEST_PACKAGE_PATH, uninstallProgressCallback, invalidCallback);
}, exceptionName + " should be thrown - given incorrect errorCallback - object.");
<head>
<title>PackageManager_uninstall_errorCallback_invoked</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MERRCB
setup({timeout: 30000});
-var t = async_test("PackageManager_uninstall_errorCallback_invoked", {timeout: 30000}),
+var t = async_test(document.title, {timeout: 30000}),
uninstallProgressCallback, uninstallError;
t.step(function () {
<head>
<title>PackageManager_uninstall_exist</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
test(function () {
assert_true("uninstall" in tizen.package, "No uninstall method in tizen.package");
check_method_exists(tizen.package, "uninstall");
-}, "PackageManager_uninstall_exist");
+}, document.title);
</script>
</body>
<head>
<title>PackageManager_uninstall_missarg</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MMA
test(function () {
var exceptionName = "TypeMismatchError";
- assert_throws({name : exceptionName}, function () {
+ assert_throws({name: exceptionName}, function () {
tizen.package.uninstall(TCT_PACKAGE_MANAGER_TEST_PACKAGE_PATH);
}, exceptionName + " should be thrown - missing argument.");
-}, "PackageManager_uninstall_missarg");
+}, document.title);
</script>
</body>
<head>
<title>PackageManager_uninstall_progressCallback_TypeMismatch</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MC
setup({timeout: 30000});
-var t = async_test("PackageManager_uninstall_progressCallback_TypeMismatch", {timeout: 30000}), uninstallProgressCallback, uninstallError,
+var t = async_test(document.title, {timeout: 30000}), uninstallProgressCallback, uninstallError,
exceptionName, i, conversionTable;
t.step(function () {
uninstallProgressCallback = conversionTable[i][0];
exceptionName = conversionTable[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.uninstall(TCT_PACKAGE_MANAGER_TEST_PACKAGE_PATH, uninstallProgressCallback, uninstallError);
}, exceptionName + " should be thrown - given incorrect listener: " + uninstallProgressCallback + ".");
<head>
<title>PackageManager_uninstall_progressCallback_invalid_cb</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MTL
setup({timeout: 30000});
-var t = async_test("PackageManager_uninstall_progressCallback_invalid_cb", {timeout: 30000}), exceptionName,
+var t = async_test(document.title, {timeout: 30000}), exceptionName,
incorrectListeners, i, uninstallError, uninstallProgressCallback;
t.step(function () {
for(i = 0; i < incorrectListeners.length; i++) {
uninstallProgressCallback = incorrectListeners[i][0];
exceptionName = incorrectListeners[i][1];
- assert_throws({name : exceptionName},
+ assert_throws({name: exceptionName},
function () {
tizen.package.uninstall(TCT_PACKAGE_MANAGER_TEST_PACKAGE_PATH, uninstallProgressCallback, uninstallError);
}, exceptionName + " should be thrown - given incorrect listener.");
<head>
<title>PackageManager_uninstall_without_errorCallback</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MMINA MR MAST
setup({timeout: 90000});
-var t = async_test("PackageManager_uninstall_without_errorCallback", {timeout: 90000}), wasInProgress = false,
+var t = async_test(document.title, {timeout: 90000}), wasInProgress = false,
uninstallProgressCallback, returnedValue = null;
t.step(function () {
assert_true(wasInProgress, "onprogress callback was not invoked.");
assert_equals(packageId, TCT_PACKAGE_MANAGER_TEST_PACKAGE_ID, "Incorrect packageId.");
- assert_throws({name : "NotFoundError"},
+ assert_throws(NOT_FOUND_EXCEPTION,
function () {
tizen.package.getPackageInfo(TCT_PACKAGE_MANAGER_TEST_PACKAGE_ID);
}, "Package is still installed.");
<head>
<title>PackageManager_unsetPackageInfoEventListener</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
setup({timeout: 90000});
var packageInformationEventCallback, returnedValue = null,
- t = async_test("PackageManager_unsetPackageInfoEventListener", {timeout: 90000});
+ t = async_test(document.title, {timeout: 90000});
t.step(function () {
packageInformationEventCallback = {
<head>
<title>PackageManager_unsetPackageInfoEventListener_exist</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
test(function () {
assert_true("unsetPackageInfoEventListener" in tizen.package, "No unsetPackageInfoEventListener method in tizen.package");
check_method_exists(tizen.package, "unsetPackageInfoEventListener");
-}, "PackageManager_unsetPackageInfoEventListener_exist");
+}, document.title);
</script>
</body>
<head>
<title>PackageManager_unsetPackageInfoEventListener_extra_argument</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA MNAEX
test(function () {
checkExtraArgument(tizen.package, "unsetPackageInfoEventListener");
-}, "PackageManager_unsetPackageInfoEventListener_extra_argument");
+}, document.title);
</script>
</body>
<head>
<title>PackageProgressCallback_notexist</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA CBNIO
test(function () {
check_no_interface_object("PackageProgressCallback");
-}, "PackageProgressCallback_notexist");
+}, document.title);
</script>
</body>
<head>
<title>PackageProgressCallback_oncomplete_install</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA CBT CBOA
setup({timeout: 90000});
-var t = async_test("PackageProgressCallback_oncomplete_install", {timeout: 90000}), installProgressCallback, installError;
+var t = async_test(document.title, {timeout: 90000}), installProgressCallback, installError;
t.step(function () {
installProgressCallback = {
<head>
<title>PackageProgressCallback_oncomplete_uninstall</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA CBT CBOA
setup({timeout: 90000});
-var t = async_test("PackageProgressCallback_oncomplete_uninstall", {timeout: 90000}),
+var t = async_test(document.title, {timeout: 90000}),
uninstallProgressCallback, uninstallError;
t.step(function () {
<head>
<title>PackageProgressCallback_onprogress_install</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA CBT CBOA
setup({timeout: 90000});
-var t = async_test("PackageProgressCallback_onprogress_install", {timeout: 90000}), wasInProgress = false,
+var t = async_test(document.title, {timeout: 90000}), wasInProgress = false,
installProgressCallback, installError;
t.step(function () {
<head>
<title>PackageProgressCallback_onprogress_uninstall</title>
<meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
<script type="text/javascript" src="support/package_common.js"></script>
</head>
//==== TEST_CRITERIA CBT CBOA
setup({timeout: 90000});
-var t = async_test("PackageProgressCallback_onprogress_uninstall", {timeout: 90000}), wasInProgress = false,
+var t = async_test(document.title, {timeout: 90000}), wasInProgress = false,
uninstallProgressCallback, uninstallError;
t.step(function () {
--- /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;
+}
+++ /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="check if PackageInformation is extendable" type="compliance" status="approved" component="TizenAPI/Application/Package" execution_type="auto" priority="P3" id="PackageInformation_extend">
+ <testcase purpose="Check if PackageInformation is extendable" type="compliance" status="approved" component="TizenAPI/Application/Package" execution_type="auto" priority="P3" id="PackageInformation_extend">
<description>
<test_script_entry>/opt/tct-package-tizen-tests/package/PackageInformation_extend.html</test_script_entry>
</description>
</spec>
</specs>
</testcase>
- <testcase purpose="check if PackageManager is extendable" type="compliance" status="approved" component="TizenAPI/Application/Package" execution_type="auto" priority="P3" id="PackageManager_extend">
+ <testcase purpose="Check if PackageManager is extendable" type="compliance" status="approved" component="TizenAPI/Application/Package" execution_type="auto" priority="P3" id="PackageManager_extend">
<description>
<test_script_entry>/opt/tct-package-tizen-tests/package/PackageManager_extend.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-package-tizen-tests/package/PackageInformation_description_attribute.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check if PackageInformation is extendable" component="TizenAPI/Application/Package" execution_type="auto" id="PackageInformation_extend">
+ <testcase purpose="Check if PackageInformation is extendable" component="TizenAPI/Application/Package" execution_type="auto" id="PackageInformation_extend">
<description>
<test_script_entry>/opt/tct-package-tizen-tests/package/PackageInformation_extend.html</test_script_entry>
</description>
<test_script_entry>/opt/tct-package-tizen-tests/package/PackageManagerObject_notexist.html</test_script_entry>
</description>
</testcase>
- <testcase purpose="check if PackageManager is extendable" component="TizenAPI/Application/Package" execution_type="auto" id="PackageManager_extend">
+ <testcase purpose="Check if PackageManager is extendable" component="TizenAPI/Application/Package" execution_type="auto" id="PackageManager_extend">
<description>
<test_script_entry>/opt/tct-package-tizen-tests/package/PackageManager_extend.html</test_script_entry>
</description>