[tv][bluetooth]DF241219-01281 add delay for check uuid 82/316982/6
authorchen <chen89.chen@samsung.com>
Fri, 20 Dec 2024 14:32:04 +0000 (22:32 +0800)
committerchen chen <chen89.chen@samsung.com>
Fri, 20 Dec 2024 14:45:35 +0000 (14:45 +0000)
Change-Id: If426b2ca23355853227e9a2b82edfe02d7aa4fc4
Signed-off-by: chen <chen89.chen@samsung.com>
common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_deviceuuid_correct.html
common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_close.html
common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_onclose_callback.html
common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_onmessage_callback.html
common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_readData.html

index 3367bfed8fcbb41c9cf23a57c2a42adce2040af5..1c425517eb3b674f0c121544ee0ae5c560747e8d 100755 (executable)
-<!DOCTYPE html>\r
-<!--\r
-Copyright (c) 2012 Intel Corporation.\r
-Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved\r
-\r
-Redistribution and use in source and binary forms, with or without modification,\r
-are permitted provided that the following conditions are met:\r
-\r
-* Redistributions of works must retain the original copyright notice, this list\r
-  of conditions and the following disclaimer.\r
-* Redistributions in binary form must reproduce the original copyright notice,\r
-  this list of conditions and the following disclaimer in the documentation\r
-  and/or other materials provided with the distribution.\r
-* Neither the name of Intel Corporation nor the names of its contributors\r
-  may be used to endorse or promote products derived from this work without\r
-  specific prior written permission.\r
-\r
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"\r
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,\r
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\r
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-Authors:\r
-        Lei, ZhanX <zhanx.lei@intel.com>\r
-        Arkadiusz Pietraszek <a.pietraszek@samsung.com>\r
-\r
--->\r
-\r
-<html>\r
-<head>\r
-<title>BluetoothAdapter_createBonding_deviceuuid_correct</title>\r
-<script src="support/unitcommon.js"></script>\r
-<script src="support/bluetooth_common.js"></script>\r
-</head>\r
-<body>\r
-\r
-<div id="log"></div>\r
-<script type="text/javascript">\r
-//==== TEST: BluetoothAdapter_createBonding_deviceuuid_correct\r
-//==== LABEL Check if device uuid is correct\r
-//==== PRIORITY P2\r
-//==== EXECUTION_TYPE manual\r
-//==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothAdapter:createBonding M\r
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html\r
-//==== PRE The bluetooth of the remote/test device MUST be turned on and discoverable from other devices. The remote device MUST register the service by pushing [Register service] button on tct-bt-helper.\r
-//==== TEST_CRITERIA MOA MAST\r
-\r
-setup({timeout: 180000});\r
-var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, onBondingError, onBondingSuccess,\r
-    message = "UUIDs: \n", i;\r
-t.step(function () {\r
-    if (BT_SUPPORT) { // network.bluetooth support\r
-      add_result_callback(function () {\r
-            clearBonding(REMOTE_DEVICE_ADDRESS);\r
-        });\r
-\r
-        onBondingSuccess = t.step_func(function (device) {\r
-            for (i = 0; i < device.uuids.length; i++) {\r
-                message += device.uuids[i] + " \n";\r
-                if (device.uuids[i] === CHAT_SERVICE_UUID) {\r
-                    t.done();\r
-                }\r
-            }\r
-            assert_unreached("Bonding device uuid is not CHAT_SERVICE_UUID. " + message);\r
-        });\r
-\r
-        onBondingError = t.step_func(function (e) {\r
-            assert_unreached("onBondingError exception " + e.message);\r
-        });\r
-\r
-        powerOnSuccess = t.step_func(function () {\r
-            adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);\r
-        });\r
-\r
-        adapter = tizen.bluetooth.getDefaultAdapter();\r
-        setPowered(t, adapter, powerOnSuccess);\r
-\r
-    } else {\r
-        t.done();\r
-    }\r
-});\r
-\r
-</script>\r
-</body>\r
-</html>\r
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012 Intel Corporation.
+Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
+
+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:
+        Lei, ZhanX <zhanx.lei@intel.com>
+        Arkadiusz Pietraszek <a.pietraszek@samsung.com>
+
+-->
+
+<html>
+<head>
+<title>BluetoothAdapter_createBonding_deviceuuid_correct</title>
+<script src="support/unitcommon.js"></script>
+<script src="support/bluetooth_common.js"></script>
+</head>
+<body>
+
+<div id="log"></div>
+<script type="text/javascript">
+//==== TEST: BluetoothAdapter_createBonding_deviceuuid_correct
+//==== LABEL Check if device uuid is correct
+//==== PRIORITY P2
+//==== EXECUTION_TYPE manual
+//==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothAdapter:createBonding M
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html
+//==== PRE The bluetooth of the remote/test device MUST be turned on and discoverable from other devices. The remote device MUST register the service by pushing [Register service] button on tct-bt-helper.
+//==== TEST_CRITERIA MOA MAST
+
+setup({timeout: 180000});
+var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, onBondingError, onBondingSuccess,
+    message = "UUIDs: \n", i, flag = false;
+t.step(function () {
+    if (BT_SUPPORT) { // network.bluetooth support
+      add_result_callback(function () {
+            clearBonding(REMOTE_DEVICE_ADDRESS);
+        });
+
+        gotDeviceInfo = t.step_func(function (device) {
+            if (device !== null && device.uuids.indexOf(CHAT_SERVICE_UUID) !== -1) {
+                t.done();
+            } else {
+                if (flag == false) {
+                    setTimeout(onBondingSuccess, 5000);
+                } else {
+                    assert_unreached("device has no service");
+                }
+                flag = true
+            }
+        });
+
+        gotDeviceError = t.step_func(function (e) {
+            assert_unreached("gotDeviceError exception:" + e.message);
+        });
+
+        onBondingSuccess = t.step_func(function (device) {
+            adapter.getDevice(REMOTE_DEVICE_ADDRESS, gotDeviceInfo, gotDeviceError);
+        });
+
+        onBondingError = t.step_func(function (e) {
+            assert_unreached("onBondingError exception " + e.message);
+        });
+
+        powerOnSuccess = t.step_func(function () {
+            adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);
+        });
+
+        adapter = tizen.bluetooth.getDefaultAdapter();
+        setPowered(t, adapter, powerOnSuccess);
+
+    } else {
+        t.done();
+    }
+});
+
+</script>
+</body>
+</html>
index 5751a8c2b2fd772f2fd1901266742c0d4c515443..ea83ae0b8d9ae4ca306b31eed8f6e69b0779a321 100755 (executable)
-<!DOCTYPE html>\r
-<!--\r
-\r
-Copyright (c) 2013 Samsung Electronics Co., Ltd. All Rights Reserved\r
-\r
-Licensed under the Apache License, Version 2.0 (the License);\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
-    http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
-limitations under the License.\r
-\r
-\r
-\r
-Authors:\r
-        Lukasz Bardeli <l.bardeli@samsung.com>\r
-        Arkadiusz Pietraszek <a.pietraszek@samsung.com>\r
-\r
--->\r
-<html>\r
-<head>\r
-<title>BluetoothSocket_close</title>\r
-<meta charset="utf-8"/>\r
-<script src="support/unitcommon.js"></script>\r
-<script src="support/bluetooth_common.js"></script>\r
-</head>\r
-<body>\r
-<div id="log"></div>\r
-<script>\r
-//==== TEST: BluetoothSocket_close\r
-//==== LABEL Proper close invocation without arguments - should work\r
-//==== PRIORITY P2\r
-//==== EXECUTION_TYPE manual\r
-//==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothSocket:close M\r
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html\r
-//==== PRE The bluetooth of the remote/test device MUST be turned on and discoverable from other devices. The remote device MUST register the service by pushing [Register service] button on tct-bt-helper.\r
-//==== TEST_CRITERIA MNA MNAST MR\r
-setup({timeout: 180000});\r
-var adapter = null, t = async_test(document.title, {timeout: 180000}), onSocketConnect, onSocketConnectedError,\r
-    gotDeviceInfo, gotDeviceError, onBondingSuccess, onBondingError, powerOnSuccess, retValue = null;\r
-t.step(function () {\r
-    if (BT_SUPPORT) { // network.bluetooth support\r
-      add_result_callback(function () {\r
-            clearBonding(REMOTE_DEVICE_ADDRESS);\r
-        });\r
-\r
-        onSocketConnect = t.step_func(function (socket) {\r
-            retValue = socket.close();\r
-            socket.onclose = t.step_func(function () {\r
-                assert_equals(retValue, undefined, "close returns wrong value");\r
-                t.done();\r
-            });\r
-        });\r
-\r
-        onSocketConnectedError = t.step_func(function (e) {\r
-            assert_unreached("onSocketConnectedError exception:" + e.message);\r
-        });\r
-\r
-        gotDeviceInfo = t.step_func(function (device) {\r
-            if (device !== null && device.uuids.indexOf(CHAT_SERVICE_UUID) !== -1) {\r
-                device.connectToServiceByUUID(CHAT_SERVICE_UUID, onSocketConnect, onSocketConnectedError);\r
-            } else {\r
-                assert_unreached("Exception. reason:  device.uuids.indexOf(CHAT_SERVICE_UUID) = " +\r
-                    device.uuids.indexOf(CHAT_SERVICE_UUID) + " device = " + device);\r
-            }\r
-        });\r
-\r
-        gotDeviceError = t.step_func(function (e) {\r
-            assert_unreached("gotDeviceError exception:" + e.message);\r
-        });\r
-\r
-        onBondingSuccess = t.step_func(function () {\r
-            adapter.getDevice(REMOTE_DEVICE_ADDRESS, gotDeviceInfo, gotDeviceError);\r
-        });\r
-\r
-        onBondingError = t.step_func(function (e) {\r
-            assert_unreached("onBondingError exception:" + e.message);\r
-        });\r
-\r
-        powerOnSuccess = t.step_func(function () {\r
-            adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);\r
-        });\r
-\r
-        adapter = tizen.bluetooth.getDefaultAdapter();\r
-        setPowered(t, adapter, powerOnSuccess);\r
-\r
-    } else {\r
-        t.done();\r
-    }\r
-});\r
-\r
-</script>\r
-</body>\r
-</html>\r
+<!DOCTYPE html>
+<!--
+
+Copyright (c) 2013 Samsung Electronics Co., Ltd. All Rights Reserved
+
+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:
+        Lukasz Bardeli <l.bardeli@samsung.com>
+        Arkadiusz Pietraszek <a.pietraszek@samsung.com>
+
+-->
+<html>
+<head>
+<title>BluetoothSocket_close</title>
+<meta charset="utf-8"/>
+<script src="support/unitcommon.js"></script>
+<script src="support/bluetooth_common.js"></script>
+</head>
+<body>
+<div id="log"></div>
+<script>
+//==== TEST: BluetoothSocket_close
+//==== LABEL Proper close invocation without arguments - should work
+//==== PRIORITY P2
+//==== EXECUTION_TYPE manual
+//==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothSocket:close M
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html
+//==== PRE The bluetooth of the remote/test device MUST be turned on and discoverable from other devices. The remote device MUST register the service by pushing [Register service] button on tct-bt-helper.
+//==== TEST_CRITERIA MNA MNAST MR
+setup({timeout: 180000});
+var adapter = null, t = async_test(document.title, {timeout: 180000}), onSocketConnect, onSocketConnectedError,
+    gotDeviceInfo, gotDeviceError, onBondingSuccess, onBondingError, powerOnSuccess, retValue = null, flag = false;
+t.step(function () {
+    if (BT_SUPPORT) { // network.bluetooth support
+      add_result_callback(function () {
+            clearBonding(REMOTE_DEVICE_ADDRESS);
+        });
+
+        onSocketConnect = t.step_func(function (socket) {
+            retValue = socket.close();
+            socket.onclose = t.step_func(function () {
+                assert_equals(retValue, undefined, "close returns wrong value");
+                t.done();
+            });
+        });
+
+        onSocketConnectedError = t.step_func(function (e) {
+            assert_unreached("onSocketConnectedError exception:" + e.message);
+        });
+
+        gotDeviceInfo = t.step_func(function (device) {
+            if (device !== null && device.uuids.indexOf(CHAT_SERVICE_UUID) !== -1) {
+                device.connectToServiceByUUID(CHAT_SERVICE_UUID, onSocketConnect, onSocketConnectedError);
+            } else {
+                if (flag == false) {
+                    setTimeout(onBondingSuccess, 5000);
+                } else {
+                    assert_unreached("Exception. reason:  device.uuids.indexOf(CHAT_SERVICE_UUID) = " +
+                    device.uuids.indexOf(CHAT_SERVICE_UUID) + " device = " + device);
+                }
+                flag = true
+            }
+        });
+
+        gotDeviceError = t.step_func(function (e) {
+            assert_unreached("gotDeviceError exception:" + e.message);
+        });
+
+        onBondingSuccess = t.step_func(function () {
+            adapter.getDevice(REMOTE_DEVICE_ADDRESS, gotDeviceInfo, gotDeviceError);
+        });
+
+        onBondingError = t.step_func(function (e) {
+            assert_unreached("onBondingError exception:" + e.message);
+        });
+
+        powerOnSuccess = t.step_func(function () {
+            adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);
+        });
+
+        adapter = tizen.bluetooth.getDefaultAdapter();
+        setPowered(t, adapter, powerOnSuccess);
+
+    } else {
+        t.done();
+    }
+});
+
+</script>
+</body>
+</html>
index 27cf1777ff9f2a762887c99f69c96c43068f25d8..19b0731bacd17ee0e6393d8750a7b92c190f51e5 100755 (executable)
-<!DOCTYPE html>\r
-<!--\r
-Copyright (c) 2012 Intel Corporation.\r
-Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved\r
-\r
-Redistribution and use in source and binary forms, with or without modification,\r
-are permitted provided that the following conditions are met:\r
-\r
-* Redistributions of works must retain the original copyright notice, this list\r
-  of conditions and the following disclaimer.\r
-* Redistributions in binary form must reproduce the original copyright notice,\r
-  this list of conditions and the following disclaimer in the documentation\r
-  and/or other materials provided with the distribution.\r
-* Neither the name of Intel Corporation nor the names of its contributors\r
-  may be used to endorse or promote products derived from this work without\r
-  specific prior written permission.\r
-\r
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"\r
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,\r
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\r
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-Authors:\r
-        Lei, ZhanX <zhanx.lei@intel.com>\r
-        Arkadiusz Pietraszek <a.pietraszek@samsung.com>\r
-\r
--->\r
-<html>\r
-<head>\r
-<title>BluetoothSocket_onclose_callback</title>\r
-<script src="support/unitcommon.js"></script>\r
-<script src="support/bluetooth_common.js"></script>\r
-</head>\r
-<body>\r
-\r
-<div id="log"></div>\r
-\r
-<ul id="testdetails" style="display:none;">\r
-    <li>Push "unregister service" button on the remote device"</li>\r
-</ul>\r
-\r
-<script>\r
-//==== TEST: BluetoothSocket_onclose_callback\r
-//==== LABEL Check if onClose callback function invoked\r
-//==== PRIORITY P1\r
-//==== EXECUTION_TYPE manual\r
-//==== STEP When you find description in below, please unregister the service at the remote device.\r
-//==== EXPECT Pass.\r
-//==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothSocket:onclose A\r
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html\r
-//==== PRE The bluetooth of the remote/test device MUST be turned on and discoverable from other devices. The remote device MUST register the service by pushing [Register service] button on tct-bt-helper.\r
-//==== TEST_CRITERIA ASG AT\r
-\r
-setup({timeout: 180000});\r
-var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, onBondingSuccess, onBondingError,\r
-    gotDeviceInfo, gotDeviceError, onSocketConnect, onSocketError;\r
-\r
-t.step(function () {\r
-    if (BT_SUPPORT) { // network.bluetooth support\r
-      add_result_callback(function () {\r
-            clearBonding(REMOTE_DEVICE_ADDRESS);\r
-        });\r
-\r
-        onSocketConnect = t.step_func(function (socket) {\r
-            socket.onmessage = t.step_func(function () {\r
-            });\r
-            socket.onclose = t.step_func(function () {\r
-                t.done();\r
-            });\r
-            assert_type(socket.onclose, "function", "onclose in BluetoothSocket has wrong type after attaching function to it");\r
-            document.getElementById("testdetails").style["display"] = "";\r
-        });\r
-\r
-        onSocketError = t.step_func(function (e) {\r
-            assert_unreached("onSocketError exception:" + e.message);\r
-        });\r
-\r
-        gotDeviceInfo = t.step_func(function (device) {\r
-            if (device !== null && device.uuids.indexOf(CHAT_SERVICE_UUID) !== -1) {\r
-                device.connectToServiceByUUID(CHAT_SERVICE_UUID, onSocketConnect, onSocketError);\r
-            } else {\r
-                assert_unreached("device has no service");\r
-            }\r
-        });\r
-\r
-        gotDeviceError = t.step_func(function (e) {\r
-            assert_unreached("gotDeviceError exception:" + e.message);\r
-        });\r
-\r
-        onBondingSuccess = t.step_func(function (device) {\r
-            adapter.getDevice(REMOTE_DEVICE_ADDRESS, gotDeviceInfo, gotDeviceError);\r
-        });\r
-\r
-        onBondingError = t.step_func(function (e) {\r
-            assert_unreached("onBondingError exception:" + e.message);\r
-        });\r
-\r
-        powerOnSuccess = t.step_func(function () {\r
-            adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);\r
-        });\r
-\r
-        adapter = tizen.bluetooth.getDefaultAdapter();\r
-        setPowered(t, adapter, powerOnSuccess);\r
-\r
-    } else {\r
-        t.done();\r
-    }\r
-});\r
-\r
-</script>\r
-</body>\r
-</html>\r
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012 Intel Corporation.
+Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
+
+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:
+        Lei, ZhanX <zhanx.lei@intel.com>
+        Arkadiusz Pietraszek <a.pietraszek@samsung.com>
+
+-->
+<html>
+<head>
+<title>BluetoothSocket_onclose_callback</title>
+<script src="support/unitcommon.js"></script>
+<script src="support/bluetooth_common.js"></script>
+</head>
+<body>
+
+<div id="log"></div>
+
+<ul id="testdetails" style="display:none;">
+    <li>Push "unregister service" button on the remote device"</li>
+</ul>
+
+<script>
+//==== TEST: BluetoothSocket_onclose_callback
+//==== LABEL Check if onClose callback function invoked
+//==== PRIORITY P1
+//==== EXECUTION_TYPE manual
+//==== STEP When you find description in below, please unregister the service at the remote device.
+//==== EXPECT Pass.
+//==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothSocket:onclose A
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html
+//==== PRE The bluetooth of the remote/test device MUST be turned on and discoverable from other devices. The remote device MUST register the service by pushing [Register service] button on tct-bt-helper.
+//==== TEST_CRITERIA ASG AT
+
+setup({timeout: 180000});
+var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, onBondingSuccess, onBondingError,
+    gotDeviceInfo, gotDeviceError, onSocketConnect, onSocketError, flag = false;
+
+t.step(function () {
+    if (BT_SUPPORT) { // network.bluetooth support
+      add_result_callback(function () {
+            clearBonding(REMOTE_DEVICE_ADDRESS);
+        });
+
+        onSocketConnect = t.step_func(function (socket) {
+            socket.onmessage = t.step_func(function () {
+            });
+            socket.onclose = t.step_func(function () {
+                t.done();
+            });
+            assert_type(socket.onclose, "function", "onclose in BluetoothSocket has wrong type after attaching function to it");
+            document.getElementById("testdetails").style["display"] = "";
+        });
+
+        onSocketError = t.step_func(function (e) {
+            assert_unreached("onSocketError exception:" + e.message);
+        });
+
+        gotDeviceInfo = t.step_func(function (device) {
+            if (device !== null && device.uuids.indexOf(CHAT_SERVICE_UUID) !== -1) {
+                device.connectToServiceByUUID(CHAT_SERVICE_UUID, onSocketConnect, onSocketError);
+            } else {
+                if (flag == false) {
+                    setTimeout(onBondingSuccess, 5000);
+                } else {
+                    assert_unreached("device has no service");
+                }
+                flag = true
+            }
+        });
+
+        gotDeviceError = t.step_func(function (e) {
+            assert_unreached("gotDeviceError exception:" + e.message);
+        });
+
+        onBondingSuccess = t.step_func(function (device) {
+            adapter.getDevice(REMOTE_DEVICE_ADDRESS, gotDeviceInfo, gotDeviceError);
+        });
+
+        onBondingError = t.step_func(function (e) {
+            assert_unreached("onBondingError exception:" + e.message);
+        });
+
+        powerOnSuccess = t.step_func(function () {
+            adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);
+        });
+
+        adapter = tizen.bluetooth.getDefaultAdapter();
+        setPowered(t, adapter, powerOnSuccess);
+
+    } else {
+        t.done();
+    }
+});
+
+</script>
+</body>
+</html>
index 1dc82b5c5f138af1a0539ec6dea345164e1b66df..a6ce35fb9c6d902b1ec05e3a3502bfa53abbca17 100755 (executable)
-<!DOCTYPE html>\r
-<!--\r
-Copyright (c) 2012 Intel Corporation.\r
-Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved\r
-\r
-Redistribution and use in source and binary forms, with or without modification,\r
-are permitted provided that the following conditions are met:\r
-\r
-* Redistributions of works must retain the original copyright notice, this list\r
-  of conditions and the following disclaimer.\r
-* Redistributions in binary form must reproduce the original copyright notice,\r
-  this list of conditions and the following disclaimer in the documentation\r
-  and/or other materials provided with the distribution.\r
-* Neither the name of Intel Corporation nor the names of its contributors\r
-  may be used to endorse or promote products derived from this work without\r
-  specific prior written permission.\r
-\r
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"\r
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,\r
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\r
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-Authors:\r
-        Lei, ZhanX <zhanx.lei@intel.com>\r
-        Arkadiusz Pietraszek <a.pietraszek@samsung.com>\r
-\r
--->\r
-<html>\r
-<head>\r
-<title>BluetoothSocket_onmessage_callback</title>\r
-<script src="support/unitcommon.js"></script>\r
-<script src="support/bluetooth_common.js"></script>\r
-</head>\r
-<body>\r
-\r
-<div id="log"></div>\r
-<script>\r
-//==== TEST: BluetoothSocket_onmessage_callback\r
-//==== LABEL Check if onMessage callback function invoked\r
-//==== PRIORITY P2\r
-//==== EXECUTION_TYPE manual\r
-//==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothSocket:onmessage A\r
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html\r
-//==== PRE The bluetooth of the remote/test device MUST be turned on and discoverable from other devices. The remote device MUST register the service by pushing [Register service] button on tct-bt-helper.\r
-//==== TEST_CRITERIA AT ASG\r
-\r
-setup({timeout: 180000});\r
-var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, onBondingSuccess, onBondingError,\r
-    gotDeviceInfo, gotDeviceError, onSocketConnect, onSocketError;\r
-\r
-t.step(function () {\r
-    if (BT_SUPPORT) { // network.bluetooth support\r
-      add_result_callback(function () {\r
-            clearBonding(REMOTE_DEVICE_ADDRESS);\r
-        });\r
-\r
-        onSocketConnect = t.step_func(function (socket) {\r
-            socket.onmessage = t.step_func(function () {\r
-                socket.close();\r
-                t.done();\r
-            });\r
-            assert_type(socket.onmessage, "function", "onmessage in BluetoothSocket has wrong type after attaching function to it");\r
-            socket.onclose = t.step_func(function () {\r
-            });\r
-        });\r
-\r
-        onSocketError = t.step_func(function (e) {\r
-            assert_unreached("onSocketError exception:" + e.message);\r
-        });\r
-\r
-        gotDeviceInfo = t.step_func(function (device) {\r
-            if (device !== null && device.uuids.indexOf(CHAT_SERVICE_UUID) !== -1) {\r
-                device.connectToServiceByUUID(CHAT_SERVICE_UUID, onSocketConnect, onSocketError);\r
-            } else {\r
-                assert_unreached("device has no service");\r
-            }\r
-        });\r
-\r
-        gotDeviceError = t.step_func(function (e) {\r
-            assert_unreached("gotDeviceError exception:" + e.message);\r
-        });\r
-\r
-        onBondingSuccess = t.step_func(function (device) {\r
-            adapter.getDevice(REMOTE_DEVICE_ADDRESS, gotDeviceInfo, gotDeviceError);\r
-        });\r
-\r
-        onBondingError = t.step_func(function (e) {\r
-            assert_unreached("onBondingError exception:" + e.message);\r
-        });\r
-\r
-        powerOnSuccess = t.step_func(function () {\r
-            adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);\r
-        });\r
-\r
-        adapter = tizen.bluetooth.getDefaultAdapter();\r
-        setPowered(t, adapter, powerOnSuccess);\r
-\r
-    } else {\r
-        t.done();\r
-    }\r
-});\r
-\r
-</script>\r
-</body>\r
-</html>\r
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012 Intel Corporation.
+Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
+
+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:
+        Lei, ZhanX <zhanx.lei@intel.com>
+        Arkadiusz Pietraszek <a.pietraszek@samsung.com>
+
+-->
+<html>
+<head>
+<title>BluetoothSocket_onmessage_callback</title>
+<script src="support/unitcommon.js"></script>
+<script src="support/bluetooth_common.js"></script>
+</head>
+<body>
+
+<div id="log"></div>
+<script>
+//==== TEST: BluetoothSocket_onmessage_callback
+//==== LABEL Check if onMessage callback function invoked
+//==== PRIORITY P2
+//==== EXECUTION_TYPE manual
+//==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothSocket:onmessage A
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html
+//==== PRE The bluetooth of the remote/test device MUST be turned on and discoverable from other devices. The remote device MUST register the service by pushing [Register service] button on tct-bt-helper.
+//==== TEST_CRITERIA AT ASG
+
+setup({timeout: 180000});
+var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, onBondingSuccess, onBondingError,
+    gotDeviceInfo, gotDeviceError, onSocketConnect, onSocketError, flag = false;
+
+t.step(function () {
+    if (BT_SUPPORT) { // network.bluetooth support
+      add_result_callback(function () {
+            clearBonding(REMOTE_DEVICE_ADDRESS);
+        });
+
+        onSocketConnect = t.step_func(function (socket) {
+            socket.onmessage = t.step_func(function () {
+                socket.close();
+                t.done();
+            });
+            assert_type(socket.onmessage, "function", "onmessage in BluetoothSocket has wrong type after attaching function to it");
+            socket.onclose = t.step_func(function () {
+            });
+        });
+
+        onSocketError = t.step_func(function (e) {
+            assert_unreached("onSocketError exception:" + e.message);
+        });
+
+        gotDeviceInfo = t.step_func(function (device) {
+            if (device !== null && device.uuids.indexOf(CHAT_SERVICE_UUID) !== -1) {
+                device.connectToServiceByUUID(CHAT_SERVICE_UUID, onSocketConnect, onSocketError);
+            } else {
+                if (flag == false) {
+                    setTimeout(onBondingSuccess, 5000);
+                } else {
+                    assert_unreached("device has no service");
+                }
+                flag = true 
+            }
+        });
+
+        gotDeviceError = t.step_func(function (e) {
+            assert_unreached("gotDeviceError exception:" + e.message);
+        });
+
+        onBondingSuccess = t.step_func(function (device) {
+            adapter.getDevice(REMOTE_DEVICE_ADDRESS, gotDeviceInfo, gotDeviceError);
+        });
+
+        onBondingError = t.step_func(function (e) {
+            assert_unreached("onBondingError exception:" + e.message);
+        });
+
+        powerOnSuccess = t.step_func(function () {
+            adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);
+        });
+
+        adapter = tizen.bluetooth.getDefaultAdapter();
+        setPowered(t, adapter, powerOnSuccess);
+
+    } else {
+        t.done();
+    }
+});
+
+</script>
+</body>
+</html>
index 52a2a445de0b46d2d96bd1ddec1eae9f4fe0af33..0cba0a9a02aa3d1d62b25025287988f588b06b86 100755 (executable)
-<!DOCTYPE html>\r
-<!--\r
-Copyright (c) 2012 Intel Corporation.\r
-Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved\r
-\r
-Redistribution and use in source and binary forms, with or without modification,\r
-are permitted provided that the following conditions are met:\r
-\r
-* Redistributions of works must retain the original copyright notice, this list\r
-  of conditions and the following disclaimer.\r
-* Redistributions in binary form must reproduce the original copyright notice,\r
-  this list of conditions and the following disclaimer in the documentation\r
-  and/or other materials provided with the distribution.\r
-* Neither the name of Intel Corporation nor the names of its contributors\r
-  may be used to endorse or promote products derived from this work without\r
-  specific prior written permission.\r
-\r
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"\r
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,\r
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\r
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-\r
-Authors:\r
-        Lei, ZhanX <zhanx.lei@intel.com>\r
-        Lukasz Bardeli <l.bardeli@samsung.com>\r
-        Arkadiusz Pietraszek <a.pietraszek@samsung.com>\r
-\r
--->\r
-<html>\r
-<head>\r
-<title>BluetoothSocket_readData</title>\r
-<script src="support/unitcommon.js"></script>\r
-<script src="support/bluetooth_common.js"></script>\r
-</head>\r
-<body>\r
-\r
-<div id="log"></div>\r
-<script>\r
-//==== TEST: BluetoothSocket_readData\r
-//==== LABEL Check if readData method correct, after sending nothing\r
-//==== PRIORITY P1\r
-//==== EXECUTION_TYPE manual\r
-//==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothSocket:readData M\r
-//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html\r
-//==== PRE The bluetooth of the remote/test device MUST be turned on and discoverable from other devices. The remote device MUST register the service by pushing [Register service] button on tct-bt-helper.\r
-//==== TEST_CRITERIA MNA MR\r
-\r
-setup({timeout: 180000});\r
-var adapter = null, t = async_test(document.title, {timeout: 180000}), onSocketConnect, retValue = null,\r
-    onSocketConnectedError, gotDeviceInfo, gotDeviceError, onBondingSuccess, onBondingError, powerOnSuccess;\r
-t.step(function () {\r
-    if (BT_SUPPORT) { // network.bluetooth support\r
-      add_result_callback(function () {\r
-            clearBonding(REMOTE_DEVICE_ADDRESS);\r
-        });\r
-\r
-        onSocketConnect = t.step_func(function (socket) {\r
-            socket.onmessage = t.step_func(function () {\r
-                retValue = socket.readData();\r
-                assert_type(retValue, "array", "readData of socket returns wrong type");\r
-                assert_array_equals(retValue, [84, 101, 115, 116], "readData of socket returns wrong value");\r
-                socket.close();\r
-\r
-                t.done();\r
-            });\r
-        });\r
-\r
-        onSocketConnectedError = t.step_func(function (e) {\r
-            assert_unreached("onSocketConnectedError exception:" + e.message);\r
-        });\r
-\r
-        gotDeviceInfo = t.step_func(function (device) {\r
-            if (device !== null && device.uuids.indexOf(CHAT_SERVICE_UUID) !== -1) {\r
-                device.connectToServiceByUUID(CHAT_SERVICE_UUID, onSocketConnect, onSocketConnectedError);\r
-            } else {\r
-                assert_unreached("Exception. reason:  device.uuids.indexOf(CHAT_SERVICE_UUID) = " +\r
-                    device.uuids.indexOf(CHAT_SERVICE_UUID) + " device = " + device);\r
-            }\r
-        });\r
-\r
-        gotDeviceError = t.step_func(function (e) {\r
-            assert_unreached("gotDeviceError exception:" + e.message);\r
-        });\r
-\r
-        onBondingSuccess = t.step_func(function () {\r
-            adapter.getDevice(REMOTE_DEVICE_ADDRESS, gotDeviceInfo, gotDeviceError);\r
-        });\r
-\r
-        onBondingError = t.step_func(function (e) {\r
-            assert_unreached("onBondingError exception:" + e.message);\r
-        });\r
-\r
-        powerOnSuccess = t.step_func(function () {\r
-            adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);\r
-        });\r
-\r
-        adapter = tizen.bluetooth.getDefaultAdapter();\r
-        setPowered(t, adapter, powerOnSuccess);\r
-\r
-    } else {\r
-        t.done();\r
-    }\r
-});\r
-\r
-</script>\r
-</body>\r
-</html>\r
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012 Intel Corporation.
+Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
+
+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:
+        Lei, ZhanX <zhanx.lei@intel.com>
+        Lukasz Bardeli <l.bardeli@samsung.com>
+        Arkadiusz Pietraszek <a.pietraszek@samsung.com>
+
+-->
+<html>
+<head>
+<title>BluetoothSocket_readData</title>
+<script src="support/unitcommon.js"></script>
+<script src="support/bluetooth_common.js"></script>
+</head>
+<body>
+
+<div id="log"></div>
+<script>
+//==== TEST: BluetoothSocket_readData
+//==== LABEL Check if readData method correct, after sending nothing
+//==== PRIORITY P1
+//==== EXECUTION_TYPE manual
+//==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothSocket:readData M
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html
+//==== PRE The bluetooth of the remote/test device MUST be turned on and discoverable from other devices. The remote device MUST register the service by pushing [Register service] button on tct-bt-helper.
+//==== TEST_CRITERIA MNA MR
+
+setup({timeout: 180000});
+var adapter = null, t = async_test(document.title, {timeout: 180000}), onSocketConnect, retValue = null,
+    onSocketConnectedError, gotDeviceInfo, gotDeviceError, onBondingSuccess, onBondingError, powerOnSuccess, flag = false;
+t.step(function () {
+    if (BT_SUPPORT) { // network.bluetooth support
+      add_result_callback(function () {
+            clearBonding(REMOTE_DEVICE_ADDRESS);
+        });
+
+        onSocketConnect = t.step_func(function (socket) {
+            socket.onmessage = t.step_func(function () {
+                retValue = socket.readData();
+                assert_type(retValue, "array", "readData of socket returns wrong type");
+                assert_array_equals(retValue, [84, 101, 115, 116], "readData of socket returns wrong value");
+                socket.close();
+
+                t.done();
+            });
+        });
+
+        onSocketConnectedError = t.step_func(function (e) {
+            assert_unreached("onSocketConnectedError exception:" + e.message);
+        });
+
+        gotDeviceInfo = t.step_func(function (device) {
+            if (device !== null && device.uuids.indexOf(CHAT_SERVICE_UUID) !== -1) {
+                device.connectToServiceByUUID(CHAT_SERVICE_UUID, onSocketConnect, onSocketConnectedError);
+            } else {
+                if (flag == false) {
+                    setTimeout(onBondingSuccess, 5000);
+                } else {
+                    assert_unreached("Exception. reason:  device.uuids.indexOf(CHAT_SERVICE_UUID) = " +
+                    device.uuids.indexOf(CHAT_SERVICE_UUID) + " device = " + device);
+                }
+                flag = true
+            }
+        });
+
+        gotDeviceError = t.step_func(function (e) {
+            assert_unreached("gotDeviceError exception:" + e.message);
+        });
+
+        onBondingSuccess = t.step_func(function () {
+            adapter.getDevice(REMOTE_DEVICE_ADDRESS, gotDeviceInfo, gotDeviceError);
+        });
+
+        onBondingError = t.step_func(function (e) {
+            assert_unreached("onBondingError exception:" + e.message);
+        });
+
+        powerOnSuccess = t.step_func(function () {
+            adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);
+        });
+
+        adapter = tizen.bluetooth.getDefaultAdapter();
+        setPowered(t, adapter, powerOnSuccess);
+
+    } else {
+        t.done();
+    }
+});
+
+</script>
+</body>
+</html>