[common][archive][DPTTIZEN-3153, add tcs about unpacking zip file by file object] 18/215618/1
authorqunfang.lin <qunfang.lin@samsung.com>
Sat, 12 Oct 2019 04:59:08 +0000 (12:59 +0800)
committerqunfang.lin <qunfang.lin@samsung.com>
Sat, 12 Oct 2019 04:59:45 +0000 (12:59 +0800)
new added: 4 tcs

Change-Id: I37b4eac213557dae1053725bd950b3b8ec2e0ed0
Signed-off-by: qunfang.lin <qunfang.lin@samsung.com>
common/tct-archive-tizen-tests/archive/ArchiveFileEntry_extract_by_FileObject.html [new file with mode: 0755]
common/tct-archive-tizen-tests/archive/ArchiveFile_add_by_FileObject.html [new file with mode: 0755]
common/tct-archive-tizen-tests/archive/ArchiveFile_extractAll_by_FileObject.html [new file with mode: 0755]
common/tct-archive-tizen-tests/archive/ArchiveManager_open_by_FileObject.html [new file with mode: 0755]
common/tct-archive-tizen-tests/tests.full.xml
common/tct-archive-tizen-tests/tests.xml

diff --git a/common/tct-archive-tizen-tests/archive/ArchiveFileEntry_extract_by_FileObject.html b/common/tct-archive-tizen-tests/archive/ArchiveFileEntry_extract_by_FileObject.html
new file mode 100755 (executable)
index 0000000..e61afb2
--- /dev/null
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2019 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:
+        Qunfang Lin <qunfang.lin@samsung.com>
+
+-->
+<html>
+<head>
+<title>ArchiveFileEntry_extract_by_FileObject</title>
+<meta charset="utf-8"/>
+<script src="support/unitcommon.js"></script>
+<script src="support/archive_common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: ArchiveFileEntry_extract_by_FileObject
+//==== LABEL Check if method extract of ArchiveFileEntry works properly by File object.
+//==== PRIORITY P1
+//==== SPEC Tizen Web API:I/O:Archive:ArchiveFileEntry:extract M
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/Archive.html
+//==== TEST_CRITERIA MR
+
+var t = async_test(document.title), createSuccess, getEntrySuccess, returnValue, entry = null,
+  extractSuccessCallback, resolveSuccess, resolveError;
+
+t.step(function () {
+    extractSuccessCallback = t.step_func(function () {
+        assert_type(returnValue, "long", "Incorrect returned value from extract()");
+        t.done();
+    });
+
+    resolveError = t.step_func(function (error) {
+        assert_unreached("resolve() error callback invoked: name:" + error.name + "msg:" + error.message);
+    });
+
+    resolveSuccess = t.step_func(function (file) {
+        returnValue = entry.extract(file, extractSuccessCallback, null, null, false, true);
+    });
+
+    getEntrySuccess = t.step_func(function (en) {
+        entry = en;
+        tizen.filesystem.resolve("downloads", resolveSuccess, resolveError);
+    });
+
+    createSuccess = t.step_func(function (archive) {
+        archive.getEntryByName("my_file.txt", getEntrySuccess);
+    });
+
+    tizen.archive.open(TEST_ARCHIVE_FILE_ZIP, "r", createSuccess);
+});
+
+</script>
+</body>
+</html>
diff --git a/common/tct-archive-tizen-tests/archive/ArchiveFile_add_by_FileObject.html b/common/tct-archive-tizen-tests/archive/ArchiveFile_add_by_FileObject.html
new file mode 100755 (executable)
index 0000000..9d3b020
--- /dev/null
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2019 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:
+        Qunfang Lin <qunfang.lin@samsung.com>
+
+-->
+
+<html>
+<head>
+<title>ArchiveFile_add_by_FileObject</title>
+<meta charset="utf-8"/>
+<script src="support/unitcommon.js"></script>
+<script src="support/archive_common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: ArchiveFile_add_by_FileObject
+//==== LABEL Check if method add of ArchiveFile works properly by File object.
+//==== PRIORITY P1
+//==== SPEC Tizen Web API:I/O:Archive:ArchiveFile:add M
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/Archive.html
+//==== TEST_CRITERIA MR MMINA
+
+var t = async_test(document.title), returnValue, createSuccess, createError, onSuccess, onError,
+  resolveZipSuccess, resolveZipError, resolveFileSuccess, resolveFileError, archive = null;
+
+t.step(function () {
+    onSuccess = t.step_func(function () {
+        assert_type(returnValue, "long", "archive.add return value type is not long");
+        t.done();
+    });
+
+    onError = t.step_func(function (error) {
+        assert_unreached("errorCallback invoked name:" + error.name + ", msg:" + error.message);
+    });
+
+    resolveFileError = t.step_func(function (error) {
+        assert_unreached("resolve() error callback invoked: name:" + error.name + "msg:" + error.message);
+    });
+
+    resolveFileSuccess = t.step_func(function (file) {
+        returnValue = archive.add(file, onSuccess, onError);
+    });
+
+    createSuccess = t.step_func(function (arc) {
+        archive = arc;
+        tizen.filesystem.resolve(TEST_ARCHIVE_FILE_TXT1, resolveFileSuccess, resolveFileError);
+
+    });
+
+    createError = t.step_func(function (error) {
+        assert_unreached("Invalid createError invoked: " + error.name + ": " + error.message);
+    });
+
+    resolveZipError = t.step_func(function (error) {
+        assert_unreached("resolve() error callback invoked: name:" + error.name + "msg:" + error.message);
+    });
+
+    resolveZipSuccess = t.step_func(function (file) {
+        tizen.archive.open(file, "rw", createSuccess, createError, {overwrite: true});
+    });
+    tizen.filesystem.resolve(TEST_ARCHIVE_FILE_ZIP1, resolveZipSuccess, resolveZipError);
+});
+
+</script>
+</body>
+</html>
diff --git a/common/tct-archive-tizen-tests/archive/ArchiveFile_extractAll_by_FileObject.html b/common/tct-archive-tizen-tests/archive/ArchiveFile_extractAll_by_FileObject.html
new file mode 100755 (executable)
index 0000000..74ff89e
--- /dev/null
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2019 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:
+        Qunfang Lin <qunfang.lin@samsung.com>
+
+-->
+<html>
+<head>
+<title>ArchiveFile_extractAll_by_FileObject</title>
+<meta charset="utf-8"/>
+<script src="support/unitcommon.js"></script>
+<script src="support/archive_common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: ArchiveFile_extractAll_by_FileObject
+//==== LABEL Check if method extractAll of ArchiveFile works properly by File object.
+//==== PRIORITY P1
+//==== SPEC Tizen Web API:I/O:Archive:ArchiveFile:extractAll M
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/Archive.html
+//==== TEST_CRITERIA MR
+
+var t = async_test(document.title), createSuccess, successCallback, returnValue,
+  archive = null, resolveSuccess, resolveError;
+
+t.step(function () {
+    successCallback = t.step_func(function () {
+        assert_type(returnValue, "long", "method should ruturn long");
+        t.done();
+    });
+
+    resolveError = t.step_func(function (error) {
+        assert_unreached("resolve() error callback invoked: name:" + error.name + "msg:" + error.message);
+    });
+
+    resolveSuccess = t.step_func(function (file) {
+        returnValue = archive.extractAll(file, successCallback, null, null, true);
+    });
+
+    createSuccess = t.step_func(function (arc) {
+        archive = arc;
+        tizen.filesystem.resolve("downloads", resolveSuccess, resolveError);
+    });
+
+    tizen.archive.open(TEST_ARCHIVE_FILE_ZIP, "r", createSuccess);
+});
+
+</script>
+</body>
+</html>
diff --git a/common/tct-archive-tizen-tests/archive/ArchiveManager_open_by_FileObject.html b/common/tct-archive-tizen-tests/archive/ArchiveManager_open_by_FileObject.html
new file mode 100755 (executable)
index 0000000..d5cb04a
--- /dev/null
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2019 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:
+        Qunfang Lin <qunfang.lin@samsung.com>
+
+-->
+<html>
+<head>
+<title>ArchiveManager_open_by_FileObject</title>
+<meta charset="utf-8"/>
+<script src="support/unitcommon.js"></script>
+<script src="support/archive_common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: ArchiveManager_open_by_FileObject
+//==== LABEL Check if method open of ArchiveManager works properly by File object.
+//==== PRIORITY P1
+//==== SPEC Tizen Web API:I/O:Archive:ArchiveManager:open M
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/Archive.html
+//==== TEST_CRITERIA MR MMINA
+
+var t = async_test(document.title), successCallback, returnedValue, resolveSuccess, resolveError;
+
+t.step(function () {
+    successCallback = t.step_func(function () {
+        assert_not_equals(returnedValue, undefined, "Incorrect value returned.");
+        t.done();
+    });
+
+    resolveError = t.step_func(function (error) {
+        assert_unreached("resolve() error callback invoked: name:" + error.name + "msg:" + error.message);
+    });
+
+    resolveSuccess = t.step_func(function (file) {
+        returnedValue = tizen.archive.open(file, "r", successCallback);
+    });
+
+    tizen.filesystem.resolve(TEST_ARCHIVE_FILE_ZIP, resolveSuccess, resolveError);
+});
+
+</script>
+</body>
+</html>
index 758685f8cc5aec2a103ee2f0f2809422b739f469..2610bbe02e344a4d9aa2483343741eabc89b21e4 100755 (executable)
           </spec>
         </specs>
       </testcase>
+      <testcase purpose="Check if method add of ArchiveFile works properly by File object." type="compliance" status="approved" component="Tizen Device APIs/IO/Archive" execution_type="auto" priority="P1" id="ArchiveFile_add_by_FileObject">
+        <description>
+          <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFile_add_by_FileObject.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="ArchiveFile" element_type="method" element_name="description" specification="Archive" section="IO" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/Archive.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
       <testcase purpose="Check if method add of ArchiveFile exists" type="compliance" status="approved" component="Tizen Device APIs/IO/Archive" execution_type="auto" priority="P0" id="ArchiveFile_add_exist">
         <description>
           <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFile_add_exist.html</test_script_entry>
           </spec>
         </specs>
       </testcase>
+      <testcase purpose="Check if method extractAll of ArchiveFile works properly by File object." type="compliance" status="approved" component="Tizen Device APIs/IO/Archive" execution_type="auto" priority="P1" id="ArchiveFile_extractAll_by_FileObject">
+        <description>
+          <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFile_extractAll_by_FileObject.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="ArchiveFile" element_type="method" element_name="description" specification="Archive" section="IO" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/Archive.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
       <testcase purpose="Check if method extractAll of ArchiveFile exists" type="compliance" status="approved" component="Tizen Device APIs/IO/Archive" execution_type="auto" priority="P0" id="ArchiveFile_extractAll_exist">
         <description>
           <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFile_extractAll_exist.html</test_script_entry>
           </spec>
         </specs>
       </testcase>
+      <testcase purpose="Check if method extract of ArchiveFileEntry works properly by File object." type="compliance" status="approved" component="Tizen Device APIs/IO/Archive" execution_type="auto" priority="P1" id="ArchiveFileEntry_extract_by_FileObject">
+        <description>
+          <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFileEntry_extract_by_FileObject.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="ArchiveFileEntry" element_type="method" element_name="description" specification="Archive" section="IO" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/Archive.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
       <testcase purpose="Check argument ArchiveFileEntry extract method destinationDirectory conversions exception" type="compliance" status="approved" component="Tizen Device APIs/IO/Archive" execution_type="auto" priority="P2" id="ArchiveFileEntry_extract_destinationDirectory_TypeMismatch">
         <description>
           <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFileEntry_extract_destinationDirectory_TypeMismatch.html</test_script_entry>
           </spec>
         </specs>
       </testcase>
+      <testcase purpose="Check if method open of ArchiveManager works properly by File object." type="compliance" status="approved" component="Tizen Device APIs/IO/Archive" execution_type="auto" priority="P1" id="ArchiveManager_open_by_FileObject">
+        <description>
+          <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveManager_open_by_FileObject.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="ArchiveManager" element_type="method" element_name="description" specification="Archive" section="IO" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/Archive.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
       <testcase purpose="Check if open method of ArchiveManager exists" type="compliance" status="approved" component="Tizen Device APIs/IO/Archive" execution_type="auto" priority="P0" id="ArchiveManager_open_exist">
         <description>
           <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveManager_open_exist.html</test_script_entry>
index 945f62a84901ab2ca1d37cf1fb76a3542c631ad4..d8aa698bf47a32c4c0056d7ca37621cf53ec7482 100755 (executable)
           <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFile_add.html</test_script_entry>
         </description>
       </testcase>
+      <testcase purpose="Check if method add of ArchiveFile works properly by File object." execution_type="auto" id="ArchiveFile_add_by_FileObject" priority="P1" component="Tizen Device APIs/IO/Archive">
+        <description>
+          <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFile_add_by_FileObject.html</test_script_entry>
+        </description>
+      </testcase>
       <testcase purpose="Check if method add of ArchiveFile exists" execution_type="auto" id="ArchiveFile_add_exist" priority="P0" component="Tizen Device APIs/IO/Archive">
         <description>
           <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFile_add_exist.html</test_script_entry>
           <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFile_extractAll.html</test_script_entry>
         </description>
       </testcase>
+      <testcase purpose="Check if method extractAll of ArchiveFile works properly by File object." execution_type="auto" id="ArchiveFile_extractAll_by_FileObject" priority="P1" component="Tizen Device APIs/IO/Archive">
+        <description>
+          <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFile_extractAll_by_FileObject.html</test_script_entry>
+        </description>
+      </testcase>
       <testcase purpose="Check if method extractAll of ArchiveFile exists" execution_type="auto" id="ArchiveFile_extractAll_exist" priority="P0" component="Tizen Device APIs/IO/Archive">
         <description>
           <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFile_extractAll_exist.html</test_script_entry>
           <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFileEntry_extract.html</test_script_entry>
         </description>
       </testcase>
+      <testcase purpose="Check if method extract of ArchiveFileEntry works properly by File object." execution_type="auto" id="ArchiveFileEntry_extract_by_FileObject" priority="P1" component="Tizen Device APIs/IO/Archive">
+        <description>
+          <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFileEntry_extract_by_FileObject.html</test_script_entry>
+        </description>
+      </testcase>
       <testcase purpose="Check argument ArchiveFileEntry extract method destinationDirectory conversions exception" execution_type="auto" id="ArchiveFileEntry_extract_destinationDirectory_TypeMismatch" priority="P2" component="Tizen Device APIs/IO/Archive">
         <description>
           <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveFileEntry_extract_destinationDirectory_TypeMismatch.html</test_script_entry>
           <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveManager_open.html</test_script_entry>
         </description>
       </testcase>
+      <testcase purpose="Check if method open of ArchiveManager works properly by File object." execution_type="auto" id="ArchiveManager_open_by_FileObject" priority="P1" component="Tizen Device APIs/IO/Archive">
+        <description>
+          <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveManager_open_by_FileObject.html</test_script_entry>
+        </description>
+      </testcase>
       <testcase purpose="Check if open method of ArchiveManager exists" execution_type="auto" id="ArchiveManager_open_exist" priority="P0" component="Tizen Device APIs/IO/Archive">
         <description>
           <test_script_entry>/opt/tct-archive-tizen-tests/archive/ArchiveManager_open_exist.html</test_script_entry>