[common][tct-download-tizen-tests][DPTTIZEN-2881 Add assert in try-catch] 40/140740/3
authorxy.qian <xy.qian@samsung.com>
Wed, 26 Jul 2017 07:29:48 +0000 (15:29 +0800)
committerqian <xy.qian@samsung.com>
Thu, 27 Jul 2017 09:37:42 +0000 (09:37 +0000)
Change-Id: I8b0498da5a0906f1547e3e9602f5c215470a2894
Signed-off-by: xy.qian <xy.qian@samsung.com>
common/tct-download-tizen-tests/download/DownloadCallback_oncanceled.html
common/tct-download-tizen-tests/download/DownloadCallback_onpaused.html
common/tct-download-tizen-tests/download/DownloadCallback_onprogress.html
common/tct-download-tizen-tests/download/DownloadManager_cancel.html
common/tct-download-tizen-tests/download/DownloadManager_pause.html
common/tct-download-tizen-tests/download/DownloadManager_resume.html
common/tct-download-tizen-tests/download/DownloadManager_setListener_downloadCallback_TypeMismatch.html
common/tct-download-tizen-tests/download/DownloadManager_setListener_downloadCallback_invalid_cb.html

index c9b27f4ee10e227bccebd15ade6045b9a22d5ad6..d6a8a127b87db548574f19870582a69f608105d7 100755 (executable)
@@ -44,7 +44,9 @@ t.step(function () {
         onprogress: t.step_func(function (id, receivedSize, totalSize) {
             try {
                 tizen.download.cancel(id);
-            } catch (e) { }
+            } catch (e) {
+                assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+            }
         }),
         onpaused: t.step_func(function (id) {
             assert_unreached("onpaused should not be reached");
index 6303e0bcd64da3887a76e45a56319c2aae279542..314a135549ae8e4f52620225c327424d3d6386b4 100755 (executable)
@@ -44,13 +44,17 @@ t.step(function () {
         onprogress: t.step_func(function (id, receivedSize, totalSize) {
             try {
                 tizen.download.pause(downloadId);
-            } catch (e) { }
+            } catch (e) {
+                assert_unreached("pause() failed: " + e.name + " with message: " + e.message);          
+            }
         }),
         onpaused: t.step_func(function (id) {
             assert_type(id, "long", "id type should be a number");
             try {
                 tizen.download.cancel(downloadId);
-            } catch (e) { }
+            } catch (e) {
+                assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+            }
         }),
         oncanceled: t.step_func(function (id) {
             t.done();
index 606b5a4e8ffaafac30fcdb8b011f2826129f92d0..abde77ddd214e5afa3ba6a00daf332f4676e297b 100755 (executable)
@@ -50,7 +50,9 @@ t.step(function () {
             assert_true(receivedSize >= 0 && receivedSize <= totalSize, "The length of receivedSize between zero and totalSize");
             try {
                 tizen.download.cancel(downloadId);
-            } catch (e) { }
+            } catch (e) {
+                assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+            }
         }),
         onpaused: t.step_func(function (id) {
             assert_unreached("onpaused should not be reached");
index 7f7a2b1889ad087c6f2afb2770bd2f72f96b20b5..c5a3f88526f2ac8cfe41b22f2c2c86077ec861ec 100755 (executable)
@@ -56,7 +56,9 @@ t.step(function () {
             assert_not_equals(id, null, "id valid");
             try {
                 retValue = tizen.download.cancel(downloadId);
-            } catch(e) { }
+            } catch(e) {
+                assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+            }
         }),
         onpaused: t.step_func(function (id) {
             assert_unreached("onpaused should not be reached");
index 418880a8b70f16b7b9d83dd5a283e2a7f8953f89..a0ec4472be0760726688ceed4928c5bec7e0902e 100755 (executable)
@@ -59,13 +59,17 @@ t.step(function () {
             assert_not_equals(id, null, "id should not be null");
             try {
                 retValue = tizen.download.pause(downloadId);
-            } catch (e) { }
+            } catch (e) {
+                assert_unreached("pause() failed: " + e.name + " with message: " + e.message);
+            }
         }),
         onpaused: t.step_func(function (id) {
             assert_equals(tizen.download.getState(downloadId), "PAUSED", "DownloadId not paused");
             try {
                 tizen.download.cancel(downloadId);
-            } catch (e) { }
+            } catch (e) {
+                assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+            }
         }),
         oncanceled: t.step_func(function (id) {
             assert_equals(retValue, undefined, "pause returns wrong value");
index adf6ee72abba95b8e6ed2c33653d55efc1fe7708..e6d9a39121f0e97bb7a57e6e015b9ee6dd923ee0 100755 (executable)
@@ -63,7 +63,9 @@ t.step(function () {
             else {
                 try {
                     tizen.download.cancel(downloadId);
-                } catch (e) { }
+                } catch (e) {
+                    assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+                }
             }
         }),
         onpaused: t.step_func(function (id) {
index 546f7a691329dd2c4fc4c65093d104e3dd6902e9..73097cc0f2463a9f09d2c8e8e9eaa8ea72b33287 100755 (executable)
@@ -56,7 +56,9 @@ t.step(function () {
     }
     try {
         tizen.download.cancel(downloadId);
-    } catch (e) {}
+    } catch (e) {
+        assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+    }
 
     t.done();
 });
index bf5297ff177bb22d1b56c3283738c2b16130c580..2cc5915bac50894930ac794fa9d893d0b11df1f1 100755 (executable)
@@ -57,7 +57,9 @@ t.step(function () {
     }
     try {
         tizen.download.cancel(downloadId);
-    } catch (e) {}
+    } catch (e) {
+        assert_unreached("cancel() failed: " + e.name + " with message: " + e.message);
+    }
 
     t.done();
 });