[common][mlpipeline][remove add_result_callback] 68/257268/1
authortangkaiyuan <kaiyuan.tang@samsung.com>
Wed, 21 Apr 2021 17:56:31 +0000 (01:56 +0800)
committertangkaiyuan <kaiyuan.tang@samsung.com>
Wed, 21 Apr 2021 17:56:41 +0000 (01:56 +0800)
The pipeline, TensorsInfo and TensorsData objects and CustomFilter will be
disposed and unregistered automatically and properly
when the test case ends (when web runtime reloads the webpage) by the implementation of Web API.
So there is no need for disposing these objects manually.

Change-Id: Iaba0a508e5189f7d77caa19c9a764fbe265e4753
Signed-off-by: tangkaiyuan <kaiyuan.tang@samsung.com>
19 files changed:
common/tct-mlpipeline-tizen-tests/mlpipeline/CustomFilter_filter.html
common/tct-mlpipeline-tizen-tests/mlpipeline/CustomFilter_filter_with_errorCallback.html
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_createPipeline_AbortError.html
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_createPipeline_with_listener.html
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter.html
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_errorCallback_invoked.html
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_filterName_InvalidValues.html
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_with_errorCallback.html
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_unregisterCustomFilter.html
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_unregisterCustomFilter_InvalidStateError.html
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_unregisterCustomFilter_filterName_InvalidValues.html
common/tct-mlpipeline-tizen-tests/mlpipeline/PipelineStateChangeListener_onstatechange.html
common/tct-mlpipeline-tizen-tests/mlpipeline/Pipeline_registerSinkListener.html
common/tct-mlpipeline-tizen-tests/mlpipeline/Pipeline_registerSinkListener_sinkListener_invalid_cb.html
common/tct-mlpipeline-tizen-tests/mlpipeline/Pipeline_registerSinkListener_sinkName_InvalidValues.html
common/tct-mlpipeline-tizen-tests/mlpipeline/Pipeline_start.html
common/tct-mlpipeline-tizen-tests/mlpipeline/Pipeline_unregisterSinkListener.html
common/tct-mlpipeline-tizen-tests/mlpipeline/Pipeline_unregisterSinkListener_sinkName_InvalidValues.html
common/tct-mlpipeline-tizen-tests/mlpipeline/SinkListener_ondata.html

index 6638ac5a7ecb5fa66688a53f16e51068e262c389..3292124798bd5d65de408812fc9d2a0aeccf81f4 100755 (executable)
@@ -39,16 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, inputTI, outputTI, customFilter;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            inputTI.dispose();
-            outputTI.dispose();
-            tizen.ml.pipeline.unregisterCustomFilter("flattenFilter");
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
     inputTI = new tizen.ml.TensorsInfo();
     inputTI.addTensorInfo("3D", "UINT8", [4, 20, 15, 1]);
     outputTI = new tizen.ml.TensorsInfo();
index 5167cc64d6f3764423e318a4d1d3c989b6b95e02..f8c17f8ec2b0896a22da5c83a5dd4af645b99382 100755 (executable)
@@ -39,16 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, inputTI, outputTI, customFilter, errorCallback;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            inputTI.dispose();
-            outputTI.dispose();
-            tizen.ml.pipeline.unregisterCustomFilter("flattenFilter");
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
     inputTI = new tizen.ml.TensorsInfo();
     inputTI.addTensorInfo("3D", "UINT8", [4, 20, 15, 1]);
     outputTI = new tizen.ml.TensorsInfo();
index 27f72c07b91944f0f72e896e1f0c9df717539d0b..c32d989729637c4f92ed5fa4053b254d194c30c6 100755 (executable)
@@ -36,13 +36,7 @@ Authors:
 
 test(function () {
     var pipeline, pipelineDefinition;
-    add_result_callback(function () {
-        try {
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
+
     pipelineDefinition = "videotestsrc num-buffers=3 " +
                         "! video/x-raw,width=20,height=15,format=BGRA " +
                         "! tensor_converter " +
index 1be27e27db648d43f52e1375f2c303b87ae8f2fb..2ea84dec1cc85602cfbb31e2f7e41a097b9581f7 100755 (executable)
@@ -38,13 +38,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, listener;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
     listener = t.step_func(function (newState) {
         if (newState === "PAUSED") {
             assert_equals(pipeline.state, "PAUSED", "Incorrect pipeline state");
index edb21e5e8f911fc8626448ca724d0536b1a73943..6f052047719aa43e1b6550163ff3b728fd236a79 100755 (executable)
@@ -39,17 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, inputTI, outputTI, retValue, customFilter;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            inputTI.dispose();
-            outputTI.dispose();
-            tizen.ml.pipeline.unregisterCustomFilter("flattenFilter");
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
-
     inputTI = new tizen.ml.TensorsInfo();
     inputTI.addTensorInfo("3D", "UINT8", [4, 20, 15, 1]);
     outputTI = new tizen.ml.TensorsInfo();
index c26566f20225c58cc5edb23ab0081c14515b47a4..4e8be8684c341f1aedfc8465040610e403f0ae8d 100755 (executable)
@@ -38,16 +38,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), inputTI, outputTI, pipeline, pipelineDefinition, customFilter, errorCB;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            inputTI.dispose();
-            outputTI.dispose();
-            tizen.ml.pipeline.unregisterCustomFilter("testfilter");
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
     inputTI = new tizen.ml.TensorsInfo();
     inputTI.addTensorInfo("ti1", "UINT8", [4, 20, 15, 1]);
     outputTI = new tizen.ml.TensorsInfo();
index 7475b040eb8aad5abf937501a5f1ee3bc48ac70f..ad0a402631fc1c50897b32848ee3380954d783cb 100755 (executable)
@@ -39,14 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), inputTI, outputTI, customFilter;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            tizen.ml.pipeline.unregisterCustomFilter("testfilter2");
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
-
     inputTI = new tizen.ml.TensorsInfo();
     inputTI.addTensorInfo("3D", "UINT8", [4, 20, 15, 1]);
     outputTI = new tizen.ml.TensorsInfo();
index 694e553b1d451a7fb6a6a3296acdd94ccda7fec8..7ba8eec06854ab2b4aad160904f7113b9525c917 100755 (executable)
@@ -38,16 +38,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), retValue, inputTI, outputTI, pipeline, pipelineDefinition, customFilter, errorCB;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            tizen.ml.pipeline.unregisterCustomFilter("flattenFilter");
-            inputTI.dispose();
-            outputTI.dispose();
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
     inputTI = new tizen.ml.TensorsInfo();
     inputTI.addTensorInfo("3D", "UINT8", [4, 20, 15, 1]);
     outputTI = new tizen.ml.TensorsInfo();
index d3e1c637c5a429caab959dc74145b3f9aa4759af..96957b7063674a484007ae09c4165e1e0acf3620 100755 (executable)
@@ -39,15 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), inputTI, outputTI, retValue, customFilter;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            inputTI.dispose();
-            outputTI.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
-
     inputTI = new tizen.ml.TensorsInfo();
     inputTI.addTensorInfo("3D", "UINT8", [4, 20, 15, 1]);
     outputTI = new tizen.ml.TensorsInfo();
index 1ecb0992b37f6107ae48947410da0103e01aec79..7cb6ae40149e816aa391f3a9e06412748fee6e83 100755 (executable)
@@ -39,17 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, inputTI, outputTI, customFilter;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            inputTI.dispose();
-            outputTI.dispose();
-            pipeline.stop();
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
-
     inputTI = new tizen.ml.TensorsInfo();
     inputTI.addTensorInfo("3D", "UINT8", [4, 20, 15, 1]);
     outputTI = new tizen.ml.TensorsInfo();
index bfbd060280dd54def8d9c6eccd73efb75ab6a38e..23a375f7b01bf40b00a9eb4517d94a5f9e120a35 100755 (executable)
@@ -39,16 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), inputTI, outputTI, customFilter;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            inputTI.dispose();
-            outputTI.dispose();
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
-
     inputTI = new tizen.ml.TensorsInfo();
     inputTI.addTensorInfo("3D", "UINT8", [4, 20, 15, 1]);
     outputTI = new tizen.ml.TensorsInfo();
index d77ec8eca4015f588bea0d9b457702bfc22e772f..dd42290c4f1bca197aecafe788442e975876a41f 100755 (executable)
@@ -39,13 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, stateChangeListener, ready = false;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
     stateChangeListener = t.step_func(function (newState) {
         if(ready) {
             assert_type(newState, "string", "pipeline state should be string");
index bf6e6a091f91e65ca44963162f27a6b38e90befc..83c3a6fa3e7529db5237fc9b5c369cb46bfcba12 100755 (executable)
@@ -39,14 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, retValue, sinkListener;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            pipeline.stop();
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
     sinkListener = t.step_func(function(sinkName, data){
         assert_type(retValue, "undefined", "Incorrect return type.");
         assert_equals(sinkName, "sinkx", "Incorrect sink name.");
index 8f37bc10b29c55bd8b20b879d582b6e70a98c013..b5d65138b5d80441c9366919cf390e8651e6a77d 100755 (executable)
@@ -39,13 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, invalidSinkListener;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
     invalidSinkListener = {
         ondata : t.step_func(function(sinkName, data){
             assert_unreached("invalid sinkListener should not be invoked: " + error.name + ", msg: " + error.message);
index b3ff3a6eb7905739a05a9ce8407952a42502dbb4..e6780e430ec1b88e020cc3e29558a289426e59b3 100755 (executable)
@@ -39,13 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, sinkListener;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
     sinkListener = t.step_func(function(sinkName, data){
         assert_unreached("sinkListener should not be invoked when sinkName is invalid");
     });
index 40ec1e76ff14a6cad7e19248d2ba0eaf9baa794d..82552029b063fc0b50906b71428f4e7fa0cf7a4c 100755 (executable)
@@ -38,14 +38,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, listener;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            pipeline.stop();
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
     listener = t.step_func(function (newState) {
         if (newState === "PLAYING") {
             assert_equals(pipeline.state, "PLAYING", "Incorrect pipeline state.");
index f04faecad9970321523f13135e16415539425f5e..6441c17ade45025ddece28adad039e3fed61b400 100755 (executable)
@@ -39,15 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, retValue, sinkListener;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            pipeline.stop();
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
-
     sinkListener = t.step_func(function(sinkName, data){
         retValue = pipeline.unregisterSinkListener("sinkx");
         assert_type(retValue, "undefined", "Incorrect return type.");
index 62c4565b635a0483f5e938d0a7b26bbf8c683c0e..36b293bb55ff771df260b3d555b2ea2058c0c5b6 100755 (executable)
@@ -39,15 +39,6 @@ setup({timeout: 90000});
 var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, retValue, sinkListener;
 
 t.step(function () {
-    add_result_callback(function () {
-        try {
-            pipeline.unregisterSinkListener("sinkx");
-            pipeline.dispose();
-        } catch (err) {
-            // do nothing in case dispose throw an exception
-        }
-    });
-
     sinkListener = t.step_func(function(sinkName, data){
     });
     pipelineDefinition = "videotestsrc num-buffers=3 " +
index c98d5a89ad0a052de0449a422e85703d6ed13345..46c95d90f3feb40032c7e2ce9f1a4ee17086a7a6 100755 (executable)
@@ -45,9 +45,6 @@ t.step(function () {
         assert_type(data, "object", "Incorrect sinkName type.");
         assert_not_equals(data, null, "data should not be null");
         assert_not_equals(data, undefined, "data should not be undefined");
-        pipeline.unregisterSinkListener("sinkx");
-        pipeline.stop();
-        pipeline.dispose();
         t.done();
     });