</spec>
</specs>
</testcase>
+ <testcase purpose="Check if CloseEvent interface exists" type="compliance" status="approved" component="WebAPI/Communication/The WebSocket API" execution_type="auto" priority="P3" id="websocket_CloseEvent_exists">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Check if CloseEvent interface exists</step_desc>
+ <expected>Pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>/opt/tct-websocket-w3c-tests/websocket/websocket_CloseEvent_exists.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion usage="true" interface="CloseEvent" specification="The WebSocket API" section="Communication" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2012/CR-websockets-20120920/</spec_url>
+ <spec_statement>Create an event that uses the CloseEvent interface, with the event name close, which does not bubble, is not cancelable, has no default action, whose wasClean attribute is initialized to true if the connection closed cleanly and false otherwise, whose code attribute is initialized to the WebSocket connection close code, and whose reason attribute is initialized to the WebSocket connection close reason decoded as UTF-8, with error handling, and dispatch the event at the WebSocket object.</spec_statement>
+ </spec>
+ </specs>
+ </testcase>
+ <testcase purpose="Check if WebSocket.bufferedAmount increases with each call to the send() method, when the connection is closed" type="compliance" status="approved" component="WebAPI/Communication/The WebSocket API" execution_type="auto" priority="P3" id="websocket_WebSocket_bufferedAmount_increase_each_call" onload_delay="10">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Check if WebSocket.bufferedAmount increases with each call to the send() method, when the connection is closed</step_desc>
+ <expected>Pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>http://127.0.0.1:8080/opt/tct-websocket-w3c-tests/websocket/websocket_WebSocket_bufferedAmount_increase_each_call.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion usage="true" interface="WebSocket" specification="The WebSocket API" section="Communication" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2012/CR-websockets-20120920/</spec_url>
+ <spec_statement/>
+ </spec>
+ </specs>
+ </testcase>
+ <testcase purpose="Check if window.WebSocket interface exists" type="compliance" status="approved" component="WebAPI/Communication/The WebSocket API" execution_type="auto" priority="P3" id="websocket_WebSocket_exists">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Check if window.WebSocket interface exists</step_desc>
+ <expected>Pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>/opt/tct-websocket-w3c-tests/websocket/websocket_WebSocket_exists.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion usage="true" interface="WebSocket" specification="The WebSocket API" section="Communication" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2012/CR-websockets-20120920/</spec_url>
+ <spec_statement>Offers bi-directional network connectivity</spec_statement>
+ </spec>
+ </specs>
+ </testcase>
+ <testcase purpose="Check if Initialize event's origin attribute to the Unicode serialization of the origin of the URL that was passed to the WebSocket object's constructor" type="compliance" status="approved" component="WebAPI/Communication/The WebSocket API" execution_type="auto" priority="P3" id="websocket_WebSocket_onmessage_MessageEvent_origin_initialize" onload_delay="10">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Check if Initialize event's origin attribute to the Unicode serialization of the origin of the URL that was passed to the WebSocket object's constructor</step_desc>
+ <expected>Pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>http://127.0.0.1:8080/opt/tct-websocket-w3c-tests/websocket/websocket_WebSocket_onmessage_MessageEvent_origin_initialize.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion usage="true" interface="WebSocket" specification="The WebSocket API" section="Communication" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2012/CR-websockets-20120920/</spec_url>
+ <spec_statement/>
+ </spec>
+ </specs>
+ </testcase>
+ <testcase purpose="Check if port is a port to which the user agent is configured to block access that expecting an exception SecurityError to be thrown" type="compliance" status="approved" component="WebAPI/Communication/The WebSocket API" execution_type="auto" priority="P3" id="websocket_WebSocket_port_block_access_exception_SecurityError" onload_delay="10">
+ <description>
+ <pre_condition/>
+ <post_condition/>
+ <steps>
+ <step order="1">
+ <step_desc>Check if port is a port to which the user agent is configured to block access that expecting an exception SecurityError to be thrown</step_desc>
+ <expected>Pass</expected>
+ </step>
+ </steps>
+ <test_script_entry>http://127.0.0.1:8080/opt/tct-websocket-w3c-tests/websocket/websocket_WebSocket_port_block_access_exception_SecurityError.html</test_script_entry>
+ </description>
+ <specs>
+ <spec>
+ <spec_assertion usage="true" interface="WebSocket" specification="The WebSocket API" section="Communication" category="Tizen W3C API Specifications"/>
+ <spec_url>http://www.w3.org/TR/2012/CR-websockets-20120920/</spec_url>
+ <spec_statement/>
+ </spec>
+ </specs>
+ </testcase>
</set>
</suite>
</test_definition>
--- /dev/null
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+ of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+ may be used to endorse or promote products derived from this work without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+ Liu, Shilong <shilongx.liu@intel.com>
+ Li, HaoX <haox.li@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title>WebSocket Test: websocket_CloseEvent_exists</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2012/CR-websockets-20120920/" />
+ <meta name="flags" content="" />
+ <meta name="assert" content="Check if CloseEvent interface exists" />
+ <script type="text/javascript" src="../resources/testharness.js"></script>
+ <script type="text/javascript" src="../resources/testharnessreport.js"></script>
+ <script type="text/javascript" src="support/websocket.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script type="text/javascript">
+ var webSocket = CreateWebSocket();
+ var t = async_test(document.title);
+ webSocket.addEventListener('open', function (evt) {
+ webSocket.close();
+ }, true);
+
+ webSocket.addEventListener('close', t.step_func(function (evt) {
+ t.done();
+ }), true);
+ </script>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+ of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+ may be used to endorse or promote products derived from this work without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+ Liu, Shilong <shilongx.liu@intel.com>
+ Li, HaoX <haox.li@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title>WebSocket Test: websocket_WebSocket_bufferedAmount_increase_each_call</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2012/CR-websockets-20120920/" />
+ <meta name="flags" content=" " />
+ <meta name="assert" content="Check if WebSocket.bufferedAmount increases with each call to the send() method, when the connection is closed" />
+ <script type="text/javascript" src="../resources/testharness.js"></script>
+ <script type="text/javascript" src="../resources/testharnessreport.js"></script>
+ <script type="text/javascript" src="support/websocket.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script type="text/javascript">
+ var WebSocket = CreateWebSocket();
+ var t = async_test(document.title, { timeout: 3000});
+
+ WebSocket.addEventListener('open', t.step_func(function (evt) {
+ WebSocket.close();
+ var data = "hello";
+ WebSocket.send(data);
+ var oneAmount = WebSocket.bufferedAmount;
+ WebSocket.send(data);
+ var twoAmount = WebSocket.bufferedAmount;
+ WebSocket.send(data);
+ var threeAmount = WebSocket.bufferedAmount;
+ WebSocket.send(data);
+ var fourAmount = WebSocket.bufferedAmount;
+
+ assert_true(fourAmount > threeAmount && threeAmount > twoAmount && twoAmount > oneAmount, "WebSocket.bufferedAmount increases with each call to the send() method");
+ t.done();
+ }), true);
+
+ </script>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+ of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+ may be used to endorse or promote products derived from this work without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+ Ge, WeiX A <weix.a.ge@intel.com>
+ Li, HaoX <haox.li@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title>WebSocket Test: websocket_WebSocket_exists</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2012/CR-websockets-20120920/" />
+ <meta name="flags" content=" " />
+ <meta name="assert" content="Check if window.WebSocket interface exists" />
+ <script type="text/javascript" src="../resources/testharness.js"></script>
+ <script type="text/javascript" src="../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script type="text/javascript">
+ test(function () {
+ assert_true("WebSocket" in window, "window.WebSocket interface exists");
+ });
+ </script>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+ of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+ may be used to endorse or promote products derived from this work without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+ Liu, Shilong <shilongx.liu@intel.com>
+ Li, HaoX <haox.li@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title>WebSocket Test: websocket_WebSocket_onmessage_MessageEvent_origin_initialize</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2012/CR-websockets-20120920/" />
+ <meta name="flags" content=" " />
+ <meta name="assert" content="Check if Initialize event's origin attribute to the Unicode serialization of the origin of the URL that was passed to the WebSocket object's constructor" />
+ <script type="text/javascript" src="../resources/testharness.js"></script>
+ <script type="text/javascript" src="../resources/testharnessreport.js"></script>
+ <script type="text/javascript" src="support/websocket.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script type="text/javascript">
+ var t = async_test(document.title, {timeout: 3000});
+ var webSocket = CreateWebSocket();
+ var isOpenCalled = false;
+ var isMessageCalled = false;
+
+ webSocket.onopen = function () {
+ isOpenCalled = true;
+ webSocket.send("Hello");
+ webSocket.close();
+ }
+
+ webSocket.onmessage = t.step_func(function (e) {
+ assert_equals(e.origin, _URL, "Event's origin attribute");
+ isMessageCalled = true;
+ t.done();
+ });
+
+ webSocket.onclose = function () {
+ t.step(function () {
+ assert_true(isOpenCalled, "WebSocket connection should be opened");
+ assert_true(isMessageCalled, "WebSocket.onmessage event should be called");
+ });
+ t.done();
+ }
+ </script>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+ of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+ may be used to endorse or promote products derived from this work without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+ Liu, Shilong <shilongx.liu@intel.com>
+
+-->
+
+<html>
+ <head>
+ <title>WebSocket Test: websocket_WebSocket_port_block_access_exception_SecurityError</title>
+ <link rel="author" title="Intel" href="http://www.intel.com" />
+ <link rel="help" href="http://www.w3.org/TR/2012/CR-websockets-20120920/" />
+ <meta name="flags" content=" " />
+ <meta name="assert" content="Check if port is a port to which the user agent is configured to block access that expecting an exception SecurityError to be thrown" />
+ <script type="text/javascript" src="../resources/testharness.js"></script>
+ <script type="text/javascript" src="../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <div id="log"></div>
+ <script type="text/javascript">
+ var t = async_test(document.title);
+ var servername = "smtp.xxx.com";
+ var port = 25;
+ var url = "wss://" + servername + ":" + port + "/";
+ t.step(function () {
+ assert_throws("SECURITY_ERR", function() { var socket = new WebSocket(url); });
+ });
+ t.done();
+ </script>
+ </body>
+</html>
\ No newline at end of file