From: chen Date: Fri, 10 Mar 2023 09:21:20 +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=refs%2Fchanges%2F13%2F289613%2F1;p=test%2Ftct%2Fweb%2Fapi.git [common][mlpipeline][fix TSEVEN-5784 asynchronous state flow fails to reach synchronous check Change-Id: Idf5ac453c1fa59a8090c393575829fcff8781b23 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."); +});