2b1444741eb821a4ac1617b491c79b0813e40df1
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2014 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         Lin Guo <lin87.guo@samsung.com>
19
20 -->
21 <html>
22 <head>
23 <title>ExifManager_saveExifInfo_errorCallback_invoked_InvalidValuesError</title>
24 <meta charset="utf-8"/>
25 <script src="support/unitcommon.js"></script>
26 <script src="support/exif_common.js"></script>
27 </head>
28 <body>
29 <div id="log"></div>
30 <script>
31 //==== TEST: ExifManager_saveExifInfo_errorCallback_invoked_InvalidValuesError
32 //==== LABEL Invoke ExifManager::saveExifInfo() method errorCallback with InvalidValuesError
33 //==== SPEC Tizen Web API:TBD:Exif:ExifManager:saveExifInfo M
34 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/exif.html
35 //==== PRIORITY P2
36 //==== TEST_CRITERIA MERRCB
37
38 setup({timeout: 30000});
39
40 var t = async_test(document.title, {timeout: 30000}), resolveSuccess, resolveFail, onSuccess, onError;
41
42 t.step(function () {
43     onSaveError = t.step_func(function (error) {
44         assert_equals(error.name, "InvalidValuesError", "Incorrect error name.");
45         t.done();
46     });
47
48     onSaveSuccess = t.step_func(function () {
49         assert_unreached("saveExifInfo method enter unexpected errorcallback");
50     });
51
52     onError = t.step_func(function (error) {
53         assert_unreached("getExifInfo method enter unexpected errorcallback:" + error.name);
54     });
55
56     onSuccess = t.step_func(function (exifInfo) {
57         exifInfo.uri = "@$%^";
58         //file of the input parameters is invalid to invoke errorCallback
59         tizen.exif.saveExifInfo(exifInfo, onSaveSuccess, onSaveError);
60     });
61
62     resolveFail = t.step_func(function (error) {
63         assert_unreached("fail to get Exif information object:" + error.name);
64     });
65
66     resolveSuccess = t.step_func(function (file) {
67         tizen.exif.getExifInfo(file.toURI(), onSuccess, onError);
68     });
69
70     tizen.filesystem.resolve(TEST_EXIF_IMAGES, resolveSuccess, resolveFail);
71 });
72
73 </script>
74 </body>
75 </html>