[common][mediacontroller][TWDAPI-219, add 6 tcs for new api] 39/206939/3
authorzhongyuan <zy123.yuan@samsung.com>
Wed, 29 May 2019 07:49:12 +0000 (15:49 +0800)
committerzhongyuan <zy123.yuan@samsung.com>
Fri, 14 Jun 2019 09:41:22 +0000 (17:41 +0800)
Change-Id: I6567c02d8a7ee7b1208152bb64f3d83bc657cf56

common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerPlaybackInfo_contentType_attribute.html [new file with mode: 0755]
common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType.html [new file with mode: 0755]
common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_contentType_TypeMismatch.html [new file with mode: 0755]
common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_contentType_invalid.html [new file with mode: 0755]
common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_exist.html [new file with mode: 0755]
common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_misarg.html [new file with mode: 0755]
common/tct-mediacontroller-tizen-tests/tests.full.xml
common/tct-mediacontroller-tizen-tests/tests.xml

diff --git a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerPlaybackInfo_contentType_attribute.html b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerPlaybackInfo_contentType_attribute.html
new file mode 100755 (executable)
index 0000000..a4d0f47
--- /dev/null
@@ -0,0 +1,46 @@
+<!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:
+        Zhongyuan Yuan <zy123.yuan@samsung.com>
+
+-->
+<html>
+<head>
+<title>MediaControllerPlaybackInfo_contentType_attribute</title>
+<meta charset="utf-8"/>
+<script src="support/unitcommon.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: MediaControllerPlaybackInfo_contentType_attribute
+//==== LABEL Check if attribute contentType of MediaControllerPlaybackInfo exists, has type string and is readonly
+//==== SPEC Tizen Web API:Multimedia:MediaController:MediaControllerPlaybackInfo:contentType A
+//==== SPEC_URL TBD
+//==== PRIORITY P1
+//==== TEST_CRITERIA AE AT ARO AVL ADV
+
+test(function () {
+    var mcServer= tizen.mediacontroller.createServer();
+    assert_equals(mcServer.playbackInfo.contentType, "UNDECIDED", "invalid default value of contentType");
+    check_readonly(mcServer.playbackInfo, "contentType", mcServer.playbackInfo.contentType, "string", "OTHER");
+    assert_in_array(mcServer.playbackInfo.contentType, ["IMAGE", "MUSIC", "VIDEO", "OTHER", "UNDECIDED"], "Incorrect value of type");
+}, document.title);
+
+</script>
+</body>
+</html>
diff --git a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType.html b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType.html
new file mode 100755 (executable)
index 0000000..ea3f976
--- /dev/null
@@ -0,0 +1,48 @@
+<!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:
+        Zhongyuan Yuan <zy123.yuan@samsung.com>
+
+-->
+<html>
+<head>
+<title>MediaControllerServer_updatePlaybackContentType</title>
+<meta charset="utf-8"/>
+<script src="support/unitcommon.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: MediaControllerServer_updatePlaybackContentType
+//==== LABEL Check if MediaControllerServer updatePlaybackContentType method works properly
+//==== SPEC Tizen Web API:Multimedia:MediaController:MediaControllerServer:updatePlaybackContentType M
+//==== SPEC_URL TBD
+//==== PRIORITY P1
+//==== TEST_CRITERIA MR MAST
+
+test(function () {
+    var mcServer, retVal = null;
+
+    mcServer= tizen.mediacontroller.createServer();
+    retVal = mcServer.updatePlaybackContentType("MUSIC");
+    assert_equals(retVal, undefined, "updatePlaybackContentType should return undefined");
+    assert_equals(mcServer.playbackInfo.contentType, "MUSIC", "contentType should be updated");
+}, document.title);
+
+</script>
+</body>
+</html>
diff --git a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_contentType_TypeMismatch.html b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_contentType_TypeMismatch.html
new file mode 100755 (executable)
index 0000000..83d8426
--- /dev/null
@@ -0,0 +1,56 @@
+<!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:
+        Zhongyuan Yuan <zy123.yuan@samsung.com>
+
+-->
+<html>
+<head>
+<title>MediaControllerServer_updatePlaybackContentType_contentType_TypeMismatch</title>
+<meta charset="utf-8"/>
+<script src="support/unitcommon.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: MediaControllerServer_updatePlaybackContentType_contentType_TypeMismatch
+//==== LABEL Check argument contentType conversions exception
+//==== SPEC Tizen Web API:Multimedia:MediaController:MediaControllerServer:updatePlaybackContentType M
+//==== SPEC_URL TBD
+//==== PRIORITY P2
+//==== TEST_CRITERIA MC
+
+test(function () {
+    var mcServer, contentType, exceptionName, i, conversionTable;
+
+    conversionTable = getTypeConversionExceptions("enum", false);
+    mcServer= tizen.mediacontroller.createServer();
+
+    for (i = 0; i < conversionTable.length; i++) {
+        contentType = conversionTable[i][0];
+        exceptionName = conversionTable[i][1];
+        assert_throws({name: exceptionName},
+            function () {
+                mcServer.updatePlaybackContentType(contentType);
+            }, exceptionName + " should be thrown - given incorrect contentType.");
+    }
+
+}, document.title);
+
+</script>
+</body>
+</html>
diff --git a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_contentType_invalid.html b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_contentType_invalid.html
new file mode 100755 (executable)
index 0000000..a58aed5
--- /dev/null
@@ -0,0 +1,48 @@
+<!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:
+        Zhongyuan Yuan <zy123.yuan@samsung.com>
+
+-->
+<html>
+<head>
+<title>MediaControllerServer_updatePlaybackContentType_contentType_invalid</title>
+<meta charset="utf-8"/>
+<script src="support/unitcommon.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: MediaControllerServer_updatePlaybackContentType_contentType_invalid
+//==== LABEL Check updatePlaybackContentType throws type exception with invalid contentType value
+//==== SPEC Tizen Web API:Multimedia:MediaController:MediaControllerServer:updatePlaybackContentType M
+//==== SPEC_URL TBD
+//==== PRIORITY P2
+//==== TEST_CRITERIA MC
+
+test(function () {
+    var mcServer;
+
+    mcServer= tizen.mediacontroller.createServer();
+    assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
+        mcServer.updatePlaybackContentType("ABC");
+    }, "Calling updatePlaybackContentType with invalid arguments should throw an exception.");
+}, document.title);
+
+</script>
+</body>
+</html>
diff --git a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_exist.html b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_exist.html
new file mode 100755 (executable)
index 0000000..b29de7e
--- /dev/null
@@ -0,0 +1,44 @@
+<!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:
+        Zhongyuan Yuan <zy123.yuan@samsung.com>
+
+-->
+<html>
+<head>
+<title>MediaControllerServer_updatePlaybackContentType_exist</title>
+<meta charset="utf-8"/>
+<script src="support/unitcommon.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: MediaControllerServer_updatePlaybackContentType_exist
+//==== LABEL Check if updatePlaybackContentType exists
+//==== SPEC Tizen Web API:Multimedia:MediaController:MediaControllerServer:updatePlaybackContentType M
+//==== SPEC_URL TBD
+//==== PRIORITY P0
+//==== TEST_CRITERIA ME
+
+test(function () {
+    var mcServer = tizen.mediacontroller.createServer();
+    check_method_exists(mcServer, "updatePlaybackContentType");
+}, document.title);
+
+</script>
+</body>
+</html>
diff --git a/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_misarg.html b/common/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_misarg.html
new file mode 100755 (executable)
index 0000000..2435710
--- /dev/null
@@ -0,0 +1,48 @@
+<!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:
+        Zhongyuan Yuan <zy123.yuan@samsung.com>
+
+-->
+<html>
+<head>
+<title>MediaControllerServer_updatePlaybackContentType_misarg</title>
+<meta charset="utf-8"/>
+<script src="support/unitcommon.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: MediaControllerServer_updatePlaybackContentType_misarg
+//==== LABEL Check if updatePlaybackContentType method called with missing non-optional argument throws an exception
+//==== SPEC Tizen Web API:Multimedia:MediaController:MediaControllerServer:updatePlaybackContentType M
+//==== SPEC_URL TBD
+//==== PRIORITY P2
+//==== TEST_CRITERIA MMA
+
+test(function () {
+    var mcServer;
+
+    mcServer= tizen.mediacontroller.createServer();
+    assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
+        mcServer.updatePlaybackContentType();
+    }, "Calling updatePlaybackContentType without arguments should throw an exception.");
+}, document.title);
+
+</script>
+</body>
+</html>
index 75e9270b24a2fd38a7deb6504dc77b34242b9d10..dd9f5da50cbcecaa8a9ca7eca0cabf9b7c317e21 100755 (executable)
           </spec>
         </specs>
       </testcase>
+      <testcase purpose="Check if MediaControllerServer updatePlaybackContentType method works properly" type="compliance" status="approved" component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" priority="P1" id="MediaControllerServer_updatePlaybackContentType">
+        <description>
+          <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="MediaControllerServer" element_type="method" element_name="updatePlaybackContentType" specification="MediaController" section="Multimedia" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/mediacontroller.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+      <testcase purpose="Check if updatePlaybackState exists" type="compliance" status="approved" component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" priority="P0" id="MediaControllerServer_updatePlaybackContentType_exist">
+        <description>
+          <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_exist.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="MediaControllerServer" element_type="method" element_name="updatePlaybackContentType" specification="MediaController" section="Multimedia" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/mediacontroller.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+      <testcase purpose="Check if updatePlaybackState method called with missing non-optional argument throws an exception" type="compliance" status="approved" component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" priority="P2" id="MediaControllerServer_updatePlaybackContentType_misarg">
+        <description>
+          <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_misarg.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="MediaControllerServer" element_type="method" element_name="updatePlaybackContentType" specification="MediaController" section="Multimedia" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/mediacontroller.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+      <testcase purpose="Check argument state conversions exception" type="compliance" status="approved" component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" priority="P2" id="MediaControllerServer_updatePlaybackContentType_contentType_TypeMismatch">
+        <description>
+          <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_contentType_TypeMismatch.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="MediaControllerServer" element_type="method" element_name="updatePlaybackContentType" specification="MediaController" section="Multimedia" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/mediacontroller.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+      <testcase purpose="Check updatePlaybackState throws type exception with invalid state value" type="compliance" status="approved" component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" priority="P2" id="MediaControllerServer_updatePlaybackContentType_contentType_invalid">
+        <description>
+          <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_contentType_invalid.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="MediaControllerServer" element_type="method" element_name="updatePlaybackContentType" specification="MediaController" section="Multimedia" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/mediacontroller.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+      <testcase purpose="Check if attribute contentType of MediaControllerPlaybackInfo exists, has type string and is readonly" type="compliance" status="approved" component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" priority="P1" id="MediaControllerPlaybackInfo_contentType_attribute">
+        <description>
+          <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerPlaybackInfo_contentType_attribute.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="MediaControllerPlaybackInfo" element_type="contentType" element_name="repeatMode" specification="MediaController" section="Multimedia" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/mediacontroller.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
     </set>
   </suite>
 </test_definition>
index 0ba9db5603f49eb5bbd95d662e2cff88149e854a..5c75edd70ebcf7781293887b1a273ddec9d7f4f0 100755 (executable)
@@ -3,7 +3,7 @@
 <test_definition>
   <suite category="Tizen Web Device APIs" extension="crosswalk" name="tct-mediacontroller-tizen-tests">
     <set name="MediaController" type="js">
-      <testcase component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" id="MediaControllerChangeRequestPlaybackInfoCallback_notexist" priority="P3" purpose="Check if interface MediaControllerChangeRequestPlaybackInfoCallback exists, it should not.">
+      <!--testcase component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" id="MediaControllerChangeRequestPlaybackInfoCallback_notexist" priority="P3" purpose="Check if interface MediaControllerChangeRequestPlaybackInfoCallback exists, it should not.">
         <description>
           <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerChangeRequestPlaybackInfoCallback_notexist.html</test_script_entry>
         </description>
         <description>
           <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerGetItemsSuccessCallback_onsuccess.html</test_script_entry>
         </description>
+      </testcase-->
+      <testcase component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" id="MediaControllerServer_updatePlaybackContentType" priority="P1" purpose="Check if MediaControllerServer updatePlaybackContentType method works properly">
+        <description>
+          <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType.html</test_script_entry>
+        </description>
+      </testcase>
+      <testcase component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" id="MediaControllerServer_updatePlaybackContentType_exist" priority="P0" purpose="Check if updatePlaybackContentType exists">
+        <description>
+          <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_exist.html</test_script_entry>
+        </description>
+      </testcase>
+      <testcase component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" id="MediaControllerServer_updatePlaybackContentType_misarg" priority="P2" purpose="Check if updatePlaybackContentType method called with missing non-optional argument throws an exception">
+        <description>
+          <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_misarg.html</test_script_entry>
+        </description>
+      </testcase>
+      <testcase component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" id="MediaControllerServer_updatePlaybackContentType_contentType_TypeMismatch" priority="P2" purpose="Check argument contentType conversions exception">
+        <description>
+          <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_contentType_TypeMismatch.html</test_script_entry>
+        </description>
+      </testcase>
+      <testcase component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" id="MediaControllerServer_updatePlaybackContentType_contentType_invalid" priority="P2" purpose="Check updatePlaybackState throws type exception with invalid contentType value">
+        <description>
+          <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerServer_updatePlaybackContentType_contentType_invalid.html</test_script_entry>
+        </description>
+      </testcase>
+      <testcase component="Tizen Device APIs/Multimedia/MediaController" execution_type="auto" id="MediaControllerPlaybackInfo_contentType_attribute" priority="P1" purpose="Check if attribute contentType of MediaControllerPlaybackInfo exists, has type string and is readonly">
+        <description>
+          <test_script_entry>/opt/tct-mediacontroller-tizen-tests/mediacontroller/MediaControllerPlaybackInfo_contentType_attribute.html</test_script_entry>
+        </description>
       </testcase>
     </set>
   </suite>