3 Copyright (c) 2021 Samsung Electronics Co., Ltd.
5 Licensed under the Apache License, Version 2.0 (the License);
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
18 Kaiyuan Tang <kaiyuan.tang@samsung.com>
23 <title>MachineLearningPipeline_registerCustomFilter_errorCallback_invoked</title>
24 <meta charset="utf-8"/>
25 <script src="support/unitcommon.js"></script>
30 //==== TEST: MachineLearningPipeline_registerCustomFilter_errorCallback_invoked
31 //==== LABEL Check if errorCallback of MachineLearningPipeline::registerCustomFilter() can be invoked
32 //==== SPEC Tizen Web API:TBD:Pipeline:MachineLearningPipeline:registerCustomFilter M
35 //==== TEST_CRITERIA MERRCB
37 setup({timeout: 90000});
38 var t = async_test(document.title, {timeout: 90000}), inputTI, outputTI, pipeline, pipelineDefinition, customFilter, errorCB;
41 add_result_callback(function () {
45 tizen.ml.pipeline.unregisterCustomFilter("testfilter");
48 // do nothing in case dispose throw an exception
51 inputTI = new tizen.ml.TensorsInfo();
52 inputTI.addTensorInfo("ti1", "UINT8", [4, 20, 15, 1]);
53 outputTI = new tizen.ml.TensorsInfo();
54 outputTI.addTensorInfo("ti1", "UINT8", [1200]);
56 customFilter = t.step_func(function (input, output) {
59 errorCB = t.step_func(function (error) {
62 tizen.ml.pipeline.registerCustomFilter("testfilter", customFilter, inputTI, outputTI, errorCB);
64 pipelineDefinition = "videotestsrc num-buffers=3 " +
65 "! video/x-raw,width=20,height=15,format=BGRA " +
66 "! tensor_converter " +
67 "! tensor_filter framework=custom-easy model=testfilter " +
68 "! appsink name=mysink";
69 pipeline = tizen.ml.pipeline.createPipeline(pipelineDefinition);