9646ec7b78cfa78421c77a93e1307acd1826461f
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2021 Samsung Electronics Co., Ltd.
4
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
8
9     http://www.apache.org/licenses/LICENSE-2.0
10
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.
16
17 Authors:
18         Chen Chen <chen89.chen@samsung.com>
19
20 -->
21 <html>
22 <head>
23 <title>MachineLearningSingle_openModelAsync_errorCallback_invoked_NotFoundError</title>
24 <meta charset="utf-8"/>
25 <script src="support/unitcommon.js"></script>
26 <script src="support/mlsinglecommon.js"></script>
27 </head>
28 <body>
29 <div id="log"></div>
30 <script>
31 //==== TEST: MachineLearningSingle_openModelAsync_errorCallback_invoked_NotFoundError
32 //==== LABEL Check MachineLearningSingle:openModelAsync method throws exception when errorCallback is invoked
33 //==== SPEC Tizen Web API:TBD:MLSingleShot:MachineLearningSingle:openModelAsync M
34 //==== SPEC_URL TBD
35 //==== PRIORITY P2
36 //==== TEST_CRITERIA MERRCB
37 setup({timeout: 900000});
38 var t = async_test(document.title, {timeout: 900000}), successCallback, errorCallback;
39
40 t.step(function () {
41     successCallback = t.step_func(function (model) {
42         assert_unreached("Success callback invoked");
43     });
44
45     errorCallback = t.step_func(function (error) {
46         assert_equals(error.name, "NotFoundError", "Incorrect error name.");
47         assert_type(error.message, "string", "Error message is not a string");
48         assert_not_equals(error.message, "", "Error message is empty");
49         t.done();
50     });
51
52     tizen.ml.single.openModelAsync("downloads/a.tflite", successCallback,
53         errorCallback, null, null, "TENSORFLOW_LITE", "ANY");
54
55 });
56
57 </script>
58 </body>
59 </html>