From: chen Date: Mon, 13 Mar 2023 05:48:59 +0000 (+0800) Subject: [common][mlpipeline][fix TSEVEN-5784 asynchronous state flow fails to reach synchrono... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=415fc97f230c9ffdb766b3321125f2ac9326dbd9;p=test%2Ftct%2Fweb%2Fapi.git [common][mlpipeline][fix TSEVEN-5784 asynchronous state flow fails to reach synchronous check] Change-Id: I9da2c9f05540135a3b181ccd0c7930b429532aeb Signed-off-by: chen --- diff --git a/common/tct-mlpipeline-tizen-tests/mlpipeline/Pipeline_stop.html b/common/tct-mlpipeline-tizen-tests/mlpipeline/Pipeline_stop.html index 846439a9a..1e19bfd26 100755 --- a/common/tct-mlpipeline-tizen-tests/mlpipeline/Pipeline_stop.html +++ b/common/tct-mlpipeline-tizen-tests/mlpipeline/Pipeline_stop.html @@ -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."); +});