[common][webmessaging][DPTTIZEN-3137, fix 2 tc issue for M69 upgrade] 20/210420/4
authorzhongyuan <zy123.yuan@samsung.com>
Fri, 19 Jul 2019 03:14:42 +0000 (11:14 +0800)
committerzhongyuan yuan <zy123.yuan@samsung.com>
Mon, 22 Jul 2019 05:13:55 +0000 (05:13 +0000)
- add 1 more tc to check misarg

Change-Id: I1bd458b2f4fe983bc107e4a3a5083c9dda8c8934

common/tct-webmessaging-w3c-tests/tests.full.xml
common/tct-webmessaging-w3c-tests/tests.xml
common/tct-webmessaging-w3c-tests/webmessaging/webmessaging_MessageEvent_initMessageEvent.html
common/tct-webmessaging-w3c-tests/webmessaging/webmessaging_MessageEvent_initMessageEvent_misarg.html [new file with mode: 0755]

index ea20a5b23dcec614156e1b531582bd86aeff591c..a51b0fd8bc67d6b50a690d475d87d7b33a8294f8 100755 (executable)
           </spec>
         </specs>
       </testcase>
+      <testcase purpose="check if initMessageEvent throws exception without required argument" type="compliance" status="approved" component="W3C_HTML5 APIs/Communication/HTML5 Web Messaging" execution_type="auto" priority="P2" id="webmessaging_MessageEvent_initMessageEvent_misarg">
+        <description>
+          <test_script_entry>/opt/tct-webmessaging-w3c-tests/webmessaging/webmessaging_MessageEvent_initMessageEvent_misarg.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion usage="true" interface="MessageEvent" specification="HTML5 Web Messaging" section="Communication" category="Tizen W3C API Specifications"/>
+            <spec_url>http://www.w3.org/TR/2015/REC-webmessaging-20150519/</spec_url>
+            <spec_statement/>
+          </spec>
+        </specs>
+      </testcase>
     </set>
   </suite>
 </test_definition>
index c2179ced3ecafb8d402b848cd86e38a729935677..4f78802be6f4469059d4578b7ad973923b5b99f4 100755 (executable)
           <test_script_entry>/opt/tct-webmessaging-w3c-tests/webmessaging/w3c/without-ports/029.html</test_script_entry>
         </description>
       </testcase>
+      <testcase component="W3C_HTML5 APIs/Communication/HTML5 Web Messaging" execution_type="auto" id="webmessaging_MessageEvent_initMessageEvent_misarg" priority="P2" purpose="check if initMessageEvent throws exception without required argument">
+        <description>
+          <test_script_entry>/opt/tct-webmessaging-w3c-tests/webmessaging/webmessaging_MessageEvent_initMessageEvent_misarg.html</test_script_entry>
+        </description>
+      </testcase>
     </set>
   </suite>
 </test_definition>
index 9d217c53d1fdf8acedbf20ac3b088e98ac62c968..35e36d68c3e73aa49f21255f4d2d214da05613eb 100755 (executable)
@@ -39,7 +39,7 @@ test(function () {
     var messageEvent, returnval;
 
     messageEvent = document.createEvent('MessageEvent');
-    returnval = messageEvent.initMessageEvent();
+    returnval = messageEvent.initMessageEvent("message");
     assert_equals(typeof(returnval), "undefined");
 }, document.title);
 
diff --git a/common/tct-webmessaging-w3c-tests/webmessaging/webmessaging_MessageEvent_initMessageEvent_misarg.html b/common/tct-webmessaging-w3c-tests/webmessaging/webmessaging_MessageEvent_initMessageEvent_misarg.html
new file mode 100755 (executable)
index 0000000..eb47b7e
--- /dev/null
@@ -0,0 +1,47 @@
+<!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>webmessaging_MessageEvent_initMessageEvent_misarg</title>
+<meta charset="utf-8"/>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: webmessaging_MessageEvent_initMessageEvent_misarg
+//==== LABEL check if initMessageEvent throws exception without required argument
+//==== SPEC Tizen Web API Specifications:TBD::MessageEvent:initMessageEvent M
+//==== SPEC_URL http://www.w3.org/TR/2015/REC-webmessaging-20150519/
+//==== PRIORITY P2
+//==== TEST_CRITERIA MMA
+
+test(function() {
+  var event = new MessageEvent("message");
+  assert_throws(new TypeError(), function() {
+    event.initMessageEvent();
+  }, "Not enough arguments to initMessageEvent");
+}, document.title);
+
+</script>
+</body>
+</html>