ce3b2c5fed96cc00b69e6951e190315b6115cbce
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2
3 <!--
4
5 Copyright (c) 2013 Samsung Electronics Co., Ltd.
6
7 Licensed under the Apache License, Version 2.0 (the License);
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11     http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18
19
20
21 Authors:
22         Mariusz Polasinski <m.polasinski@samsung.com>
23
24
25 -->
26
27 <html>
28
29 <head>
30 <title>SQLDataControlConsumer_insert_successCallback_TypeMismatch</title>
31 <meta charset="utf-8">
32 <script type="text/javascript" src="support/unitcommon.js"></script>
33 <script src="support/datacontrol_common.js"></script>
34 </head>
35
36 <body>
37 <div id="log"></div>
38 <script type="text/javascript">
39
40 //==== TEST: SQLDataControlConsumer_insert_successCallback_TypeMismatch
41 //==== LABEL Check optional argument successCallback (insert method) type conversion
42 //==== ONLOAD_DELAY 30
43 //==== SPEC Tizen Web API:TBD:Datacontrol:SQLDataControlConsumer:insert M
44 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/datacontrol.html
45 //==== PRIORITY P2
46 //==== TEST_CRITERIA MC
47
48 setup({timeout: 30000});
49
50 var t = async_test(document.title, {timeout: 30000}), i, rowData, globalDataControl,
51     globalReqId = generateGlobalReqId(), currentDate = new Date().getTime().toString(),
52     conversionTable = getTypeConversionExceptions("functionObject", true);
53 t.step(function () {
54
55     rowData = {
56         columns: ["WORD", "WORD_DESC"],
57         values: ["'" + currentDate + "'", "'" + currentDate + "_desc'"]
58     };
59
60     globalDataControl = tizen.datacontrol.getDataControlConsumer(PROVIDER_ID, DATA_ID, TYPE_SQL);
61
62     for (i = 0; i < conversionTable.length; i++) {
63         assert_throws({name: conversionTable[i][1]}, function () {
64             globalDataControl.insert(globalReqId, rowData, conversionTable[i][0]);
65         }, "exception should be thrown. Given - " + conversionTable[i][0]);
66         globalReqId++;
67     }
68
69     t.done();
70
71 });
72
73 </script>
74 </body>
75 </html>