[common][mlpipeline][fix TSEVEN-5784 asynchronous state flow fails to reach synchrono... 13/289613/1
authorchen <chen89.chen@samsung.com>
Fri, 10 Mar 2023 09:21:20 +0000 (17:21 +0800)
committerchen chen <chen89.chen@samsung.com>
Fri, 10 Mar 2023 09:22:21 +0000 (09:22 +0000)
Change-Id: Idf5ac453c1fa59a8090c393575829fcff8781b23
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>