[DataControl] Update TCT due to API maintainer comment
authorTomasz Kusmierz <t.kusmierz@samsung.com>
Tue, 30 Jul 2013 07:52:11 +0000 (09:52 +0200)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Tue, 30 Jul 2013 14:07:49 +0000 (14:07 +0000)
Change-Id: I14c6e9bb19c3a344b0981bb0efaaf392f25f3e28

tct-datacontrol-tizen-tests/datacontrol/MappedDataControlConsumer_getValue_error_invoked.html [new file with mode: 0644]
tct-datacontrol-tizen-tests/datacontrol/MappedDataControlConsumer_updateValue_error_invoked.html [new file with mode: 0644]
tct-datacontrol-tizen-tests/tests.xml

diff --git a/tct-datacontrol-tizen-tests/datacontrol/MappedDataControlConsumer_getValue_error_invoked.html b/tct-datacontrol-tizen-tests/datacontrol/MappedDataControlConsumer_getValue_error_invoked.html
new file mode 100644 (file)
index 0000000..af634a1
--- /dev/null
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<!--
+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:
+    Tomasz Kusmierz <t.kusmierz@samsung.com>
+
+-->
+<html>
+<head>
+<title>MappedDataControlConsumer_getValue_error_invoked</title>
+<meta charset="utf-8"/>
+<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/datacontrol_common.js"></script>
+</head>
+
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: MappedDataControlConsumer_getValue_error_invoked
+//==== LABEL Check errorCallback invocation of MappedDataControlConsumer.getValue method
+//==== SPEC Tizen Web API:TBD:Datacontrol:MappedDataControlConsumer:getValue M
+//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/datacontrol.html
+//==== TIMEOUT 10
+//==== ONLOAD_DELAY 20
+//==== TEST_CRITERIA MERRCB
+setup({timeout: 10000});
+
+var t = async_test("MappedDataControlConsumer_getValue_error_invoked", {timeout: 10000}),
+    globalDataControl, globalReqId = generateGlobalReqId(),
+    currentDate = new Date().getTime().toString(), key =  currentDate,
+    getSuccess, getError;
+
+t.step(function () {
+    getSuccess = t.step_func(function (values, reqId) {
+        assert_unreached("getValue() error Callback shoulkd be invoked.");
+    });
+    getError = t.step_func(function (reqId, error) {
+        assert_equals(reqId, globalReqId, "incorrect request id");
+        assert_equals(error.code, 8, "incorrect error code");
+        assert_equals(error.name, "NotFoundError", "incorrect exception name.");
+        assert_type(error.message, "string", "error.message is not a string");
+        assert_not_equals(error.message, "", "error.message is empty.");
+        t.done();
+    });
+
+    globalDataControl = tizen.datacontrol.getDataControlConsumer(PROVIDER_ID, DATA_ID, TYPE_MAP);
+    globalDataControl.getValue(globalReqId, key, getSuccess, getError);
+});
+</script>
+</body>
+</html>
diff --git a/tct-datacontrol-tizen-tests/datacontrol/MappedDataControlConsumer_updateValue_error_invoked.html b/tct-datacontrol-tizen-tests/datacontrol/MappedDataControlConsumer_updateValue_error_invoked.html
new file mode 100644 (file)
index 0000000..76f850e
--- /dev/null
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<!--
+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:
+    Tomasz Kusmierz <t.kusmierz@samsung.com>
+
+-->
+<html>
+<head>
+<title>MappedDataControlConsumer_updateValue_error_invoked</title>
+<meta charset="utf-8"/>
+<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/datacontrol_common.js"></script>
+</head>
+
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: MappedDataControlConsumer_updateValue_error_invoked
+//==== LABEL Check errorCallback invocation of MappedDataControlConsumer.updateValue method
+//==== SPEC Tizen Web API:TBD:Datacontrol:MappedDataControlConsumer:updateValue M
+//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/datacontrol.html
+//==== TIMEOUT 10
+//==== ONLOAD_DELAY 20
+//==== TEST_CRITERIA MERRCB
+setup({timeout: 10000});
+
+var t = async_test("MappedDataControlConsumer_updateValue_error_invoked", {timeout: 10000}),
+    globalDataControl, globalReqId = generateGlobalReqId(),
+    currentDate = new Date().getTime().toString(), key =  currentDate,
+    value = currentDate + "value",
+    updateSuccess, updateError;
+
+t.step(function () {
+    updateSuccess = t.step_func(function (values, reqId) {
+        assert_unreached("updateValue() error Callback shoulkd be invoked.");
+    });
+    updateError = t.step_func(function (reqId, error) {
+        assert_equals(reqId, globalReqId, "incorrect request id");
+        assert_equals(error.code, 8, "incorrect error code");
+        assert_equals(error.name, "NotFoundError", "incorrect exception name.");
+        assert_type(error.message, "string", "error.message is not a string");
+        assert_not_equals(error.message, "", "error.message is empty.");
+        t.done();
+    });
+
+    globalDataControl = tizen.datacontrol.getDataControlConsumer(PROVIDER_ID, DATA_ID, TYPE_MAP);
+    globalDataControl.updateValue(globalReqId, key, value, value + "2", updateSuccess, updateError);
+});
+</script>
+</body>
+</html>
index c1ec693315d0c24e1867db0ff6d4ca4f5f13014e..95049d94baebc7611af264252bb671c5fce9b207 100644 (file)
           </spec>
         </specs>
       </testcase>
+      <testcase purpose="Check errorCallback invocation of MappedDataControlConsumer.getValue method" type="compliance" onload_delay="20" status="approved" component="TizenAPI/TBD/Datacontrol" execution_type="auto" priority="P1" id="MappedDataControlConsumer_getValue_error_invoked">
+        <description>
+          <test_script_entry timeout="10">/opt/tct-datacontrol-tizen-tests/datacontrol/MappedDataControlConsumer_getValue_error_invoked.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="MappedDataControlConsumer" element_type="method" element_name="getValue" specification="Datacontrol" section="TBD" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/datacontrol.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+      <testcase purpose="Check errorCallback invocation of MappedDataControlConsumer.updateValue method" type="compliance" onload_delay="20" status="approved" component="TizenAPI/TBD/Datacontrol" execution_type="auto" priority="P1" id="MappedDataControlConsumer_updateValue_error_invoked">
+        <description>
+          <test_script_entry timeout="10">/opt/tct-datacontrol-tizen-tests/datacontrol/MappedDataControlConsumer_updateValue_error_invoked.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion interface="MappedDataControlConsumer" element_type="method" element_name="updateValue" specification="Datacontrol" section="TBD" category="Tizen Device API Specifications"/>
+            <spec_url>https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/datacontrol.html</spec_url>
+            <spec_statement>TBD</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
     </set>
   </suite>
 </test_definition>