[common][mlpipeline][fix TSEVEN-5784 asynchronous state flow fails to reach synchrono... 63/289663/1
authorchen <chen89.chen@samsung.com>
Mon, 13 Mar 2023 05:48:59 +0000 (13:48 +0800)
committerchen <chen89.chen@samsung.com>
Mon, 13 Mar 2023 05:49:08 +0000 (13:49 +0800)
Change-Id: I9da2c9f05540135a3b181ccd0c7930b429532aeb
Signed-off-by: chen <chen89.chen@samsung.com>
common/tct-mlpipeline-tizen-tests/mlpipeline/Pipeline_stop.html

index 846439a9a4492e0e65948a281b16b1fc0ceb623f..1e19bfd26e02a0b6162771169178b3b35080b172 100755 (executable)
@@ -34,17 +34,26 @@ Authors:
 //==== PRIORITY P1
 //==== TEST_CRITERIA MR MNA MNAST
 
-test(function () {
-    var pipeline, pipelineDefinition, retValue;
+setup({timeout: 90000});
+var t = async_test(document.title, {timeout: 90000}), pipeline, pipelineDefinition, listener;
+
+t.step(function () {
+    listener = t.step_func(function (newState) {
+        if (newState === "PAUSED") {
+            pipeline.start();
+            assert_equals(pipeline.state, "PLAYING", "Incorrect pipeline state");
+            retValue = pipeline.stop();
+            assert_type(retValue, "undefined", "Incorrect return type.");
+            assert_equals(pipeline.state, "PAUSED", "Incorrect pipeline state.");
+            pipeline.dispose();
+            t.done();
+        }
+    });
 
     pipelineDefinition = "videotestsrc ! tizenwlsink";
-    pipeline = tizen.ml.pipeline.createPipeline(pipelineDefinition);
-    pipeline.start();
-    retValue = pipeline.stop();
-    assert_type(retValue, "undefined", "Incorrect return type.");
-    assert_equals(pipeline.state, "PAUSED", "Incorrect pipeline state.");
-    pipeline.dispose();
-}, document.title);
+    pipeline = tizen.ml.pipeline.createPipeline(pipelineDefinition, listener);
+    assert_type(pipeline, "object", "Incorrect return type.");
+});
 
 </script>
 </body>