[Bluetooth] Fix incorrect power state
authorJunghyuk Park <junghyuk.park@samsung.com>
Wed, 25 Sep 2013 05:49:06 +0000 (14:49 +0900)
committerJunghyuk Park <junghyuk.park@samsung.com>
Wed, 25 Sep 2013 05:49:06 +0000 (14:49 +0900)
Change-Id: I96eb6ee49d4a009cde77e75b96f70314883cc2b8

tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_discoverDevices_callback_onerror.html [changed mode: 0644->0755]
tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_stopDiscovery_callback_onerror.html [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index b3b6757..6d33675
@@ -25,6 +25,7 @@ Authors:
 <head>
 <title>BluetoothAdapter_discoverDevices_callback_onerror</title>
 <script src="../resources/unitcommon.js"></script>
+<script src="support/bluetooth_common.js"></script>
 </head>
 <body>
 <div id="log"></div>
@@ -37,8 +38,8 @@ Authors:
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html
 //==== TEST_CRITERIA MERRCB
 setup({timeout:90000});
-var adapter = null, t = async_test("BluetoothAdapter_discoverDevices_callback_onerror",{ timeout:90000 }), stopDiscoverySuccess,
-    discoverDevicesSuccessCB, errorCallback;
+var adapter = null, t = async_test("BluetoothAdapter_discoverDevices_callback_onerror",{ timeout:90000 }), powerOffSuccess,
+    powerOffError,discoverDevicesSuccessCB, errorCallback;
 t.step(function () {
     discoverDevicesSuccessCB = {
         onstarted: t.step_func(function () {
@@ -59,12 +60,16 @@ t.step(function () {
 
         t.done();
     });
-    stopDiscoverySuccess = t.step_func(function () {
+    powerOffSuccess = t.step_func(function () {
         adapter.discoverDevices(discoverDevicesSuccessCB,errorCallback);
     });
 
+    powerOffError = t.step_func(function (e) {
+        assert_unreached("powerOffError exception:" + e.message);
+    });
+
     adapter = tizen.bluetooth.getDefaultAdapter();
-    stopDiscovery(t, adapter, stopDiscoverySuccess);
+    adapter.setPowered(false, powerOffSuccess, powerOffError);
 });
 </script>
 </body>
old mode 100644 (file)
new mode 100755 (executable)
index 607ceab..f4dc9a4
@@ -21,11 +21,9 @@ Authors:
         Witold Choinkowski <w.choinkowsk@samsung.com>
 
 -->
-<html lang="en">
-
+<html>
 <head>
-<title>Contact/BluetoothAdapter_stopDiscovery_callback_onerror</title>
-<meta charset="utf-8">
+<title>BluetoothAdapter_stopDiscovery_callback_onerror</title>
 <script src="../resources/unitcommon.js"></script>
 <script src="support/bluetooth_common.js"></script>
 </head>
@@ -40,8 +38,8 @@ Authors:
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html#discoverDevicesid2316511
 //==== TEST_CRITERIA MERRCB
 setup({timeout:90000});
-var adapter, t = async_test("BluetoothAdapter_stopDiscovery_callback_onerror", {timeout: 90000}), stopDiscoverySuccess,
-    successCallback, errorCallback;
+var adapter, t = async_test("BluetoothAdapter_stopDiscovery_callback_onerror", {timeout: 90000}), powerOffSuccess,
+    powerOffError, successCallback, errorCallback;
 t.step(function () {
     errorCallback = t.step_func(function (error) {
         assert_equals(error.name, "ServiceNotAvailableError", "expected another error");
@@ -52,13 +50,16 @@ t.step(function () {
     successCallback = t.step_func(function () {
         assert_unreached("invalid successCallback invoked");
     });
-    stopDiscoverySuccess = t.step_func(function () {
+    powerOffSuccess = t.step_func(function () {
         adapter.stopDiscovery(successCallback, errorCallback);
     });
 
-    adapter = tizen.bluetooth.getDefaultAdapter();
-    stopDiscovery(t, adapter, stopDiscoverySuccess);
+    powerOffError = t.step_func(function (e) {
+        assert_unreached("powerOffError exception:" + e.message);
+    });
 
+    adapter = tizen.bluetooth.getDefaultAdapter();
+    adapter.setPowered(false, powerOffSuccess, powerOffError);
 });
 </script>
 </body>