+++ /dev/null
-<!DOCTYPE html>
-<!--
-Copyright (c) 2015 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:
- Mengli Zhang <mengli.zhang@samsung.com>
-
--->
-
-<html>
-<head>
-<title>cordova_FileTransferError_onprogress</title>
-<script src="support/unitcommon.js"></script>
-<script src="../cordova/cordova.js"></script>
-<script src="support/cordova_file-transfer_common.js"></script>
-</head>
-
-<body>
-<div id="log"></div>
-<script>
-//==== TEST: cordova_FileTransferError_onprogress
-//==== LABEL Check if FileTransferError onchanged is called and if its arguments have proper type
-//==== SPEC Cordova Plugin API:file-transfer:FileTransfer:upload M
-//==== SPEC_URL https://www.npmjs.com/package/cordova-plugin-file-transfer
-//==== PRIORITY P1
-//==== TEST_CRITERIA CBT CBOA
-
-var t = async_test(document.title, {timeout: 5000}), deviceready, options, fileURL, fileTransfer, uri,
- successCallback, errorCallback;
-
-t.step(function () {
- errorCallback = t.step_func(function (event) {
- assert_type(event, "object", "event has wrong type");
- assert_not_equals(event, null, "event should not be null");
- assert_not_equals(event, undefined, "event should not be undefined");
- t.done();
- });
-
- successCallback = t.step_func(function () {
- assert_unreached("upload() successCallback should not be invoked.");
- });
-
- deviceready =t.step_func(function () {
- fileTransfer = new FileTransfer();
- uri = encodeURI("http://127.0.0.1/opt/tct-file-transfer-cordova-tests/file-transfer/support/upload.php");
- fileTransfer.upload(FILE_URL, uri, successCallback, errorCallback);
- });
-
- document.addEventListener("deviceready", deviceready, true);
-});
-
-</script>
-</body>
-</html>
\ No newline at end of file
<script src="../cordova/cordova.js"></script>
<script src="support/cordova_file-transfer_common.js"></script>
</head>
-
<body>
<div id="log"></div>
<script>
//==== TEST: cordova_FileUploadResult_onprogress
-//==== LABEL Check if FileUploadResult onchanged is called and if its arguments have proper type
+//==== LABEL Check if FileUploadResult onprogress is called and if its arguments have proper type
//==== SPEC Cordova Plugin API:file-transfer:FileTransfer:upload M
//==== SPEC_URL https://www.npmjs.com/package/cordova-plugin-file-transfer
//==== PRIORITY P1
//==== TEST_CRITERIA CBT CBOA
-var t = async_test(document.title, {timeout: 5000}), deviceready, options, fileURL, fileTransfer, uri,
+var t = async_test(document.title, {timeout: 5000}), deviceready, fileTransfer, uri, onprogress,
successCallback, errorCallback;
t.step(function () {
errorCallback = t.step_func(function (event) {
+ });
+
+ successCallback = t.step_func(function () {
+ });
+
+ onprogress = t.step_func(function (event) {
assert_type(event, "object", "event has wrong type");
assert_not_equals(event, null, "event should not be null");
assert_not_equals(event, undefined, "event should not be undefined");
t.done();
});
- successCallback = t.step_func(function () {
- assert_unreached("upload() errorCallback should not be invoked.");
- });
-
deviceready =t.step_func(function () {
fileTransfer = new FileTransfer();
uri = encodeURI("http://127.0.0.1/opt/tct-file-transfer-cordova-tests/file-transfer/support/upload.php");
+ fileTransfer.onprogress = onprogress;
fileTransfer.upload(FILE_URL, uri, successCallback, errorCallback);
});
</script>
</body>
-</html>
\ No newline at end of file
+</html>
<test_definition>
<suite name="tct-file-transfer-cordova-tests" extension="crosswalk" category="Cordova Plugin APIs">
<set name="Filetransfer" type="js">
- <testcase purpose="Check if FileTransferError onchanged is called and if its arguments have proper type" type="compliance" status="approved" component="TizenAPI/Cordova/Filetransfer" execution_type="auto" priority="P1" id="cordova_FileTransferError_onprogress">
- <description>
- <test_script_entry>/opt/tct-file-transfer-cordova-tests/file-transfer/cordova_FileTransferError_onprogress.html</test_script_entry>
- </description>
- <specs>
- </specs>
- </testcase>
- <testcase purpose="Check if abort() method correctly abort file" type="compliance" status="approved" component="TizenAPI/Cordova/Filetransfer" execution_type="auto" priority="P1" id="cordova_FileTransfer_abort">
- <description>
- <test_script_entry>/opt/tct-file-transfer-cordova-tests/file-transfer/cordova_FileTransfer_abort.html</test_script_entry>
- </description>
- <specs>
- </specs>
- </testcase>
<testcase purpose="Check if method abort exists" type="compliance" status="approved" component="TizenAPI/Cordova/Filetransfer" execution_type="auto" priority="P0" id="cordova_FileTransfer_abort_exist">
<description>
<test_script_entry>/opt/tct-file-transfer-cordova-tests/file-transfer/cordova_FileTransfer_abort_exist.html</test_script_entry>
<test_definition>
<suite name="tct-file-transfer-cordova-tests" extension="crosswalk" category="Cordova Plugin APIs">
<set name="Filetransfer" type="js">
- <testcase purpose="Check if FileTransferError onchanged is called and if its arguments have proper type" component="TizenAPI/Cordova/Filetransfer" execution_type="auto" priority="P1" id="cordova_FileTransferError_onprogress">
- <description>
- <test_script_entry>/opt/tct-file-transfer-cordova-tests/file-transfer/cordova_FileTransferError_onprogress.html</test_script_entry>
- </description>
- </testcase>
<testcase purpose="Check if abort() method correctly abort file" component="TizenAPI/Cordova/Filetransfer" execution_type="auto" priority="P1" id="cordova_FileTransfer_abort">
<description>
<test_script_entry>/opt/tct-file-transfer-cordova-tests/file-transfer/cordova_FileTransfer_abort.html</test_script_entry>