OLD | NEW |
1 var throwOnToStringObject = { }; | 1 var throwOnToStringObject = { }; |
2 throwOnToStringObject.toString = function () { throw "Cannot call toString on th
is object." }; | 2 throwOnToStringObject.toString = function () { throw "Cannot call toString on th
is object." }; |
3 | 3 |
4 var throwOnGetLengthObject = { }; | 4 var throwOnGetLengthObject = { }; |
5 throwOnGetLengthObject.__defineGetter__("length", function () { throw "Cannot ge
t length of this object."; }); | 5 throwOnGetLengthObject.__defineGetter__("length", function () { throw "Cannot ge
t length of this object."; }); |
6 | 6 |
7 var throwOnGetZeroObject = { length: 1 }; | 7 var throwOnGetZeroObject = { length: 1 }; |
8 throwOnGetZeroObject.__defineGetter__("0", function () { throw "Cannot get 0 pro
perty of this object."; }); | 8 throwOnGetZeroObject.__defineGetter__("0", function () { throw "Cannot get 0 pro
perty of this object."; }); |
9 | 9 |
| 10 function createIterable(iterations) { |
| 11 return { |
| 12 [Symbol.iterator]() { |
| 13 var i = 0; |
| 14 return {next: () => iterations[i++]}; |
| 15 }, |
| 16 }; |
| 17 } |
| 18 var emptyIterableObject = createIterable([{done: true}]); |
| 19 var singleItemIterableObject = createIterable([{done: false, value: "arg0"}, {do
ne: true}]); |
| 20 |
10 var expectNoException = [ | 21 var expectNoException = [ |
11 'null', | 22 'null', |
12 'undefined', | 23 'undefined', |
13 '0', | 24 '0', |
14 '""', | 25 '""', |
15 '"", null', | 26 '"", null', |
16 '"", undefined', | 27 '"", undefined', |
17 '"", []', | 28 '"", []', |
18 '"", [ "arg0" ]', | 29 '"", [ "arg0" ]', |
19 '"", { length: 0 }', | 30 '"", emptyIterableObject', |
20 '"", { length: 1, 0: "arg0" }', | 31 '"", singleItemIterableObject', |
21 '"", null, null', | 32 '"", null, null', |
22 '"", null, undefined', | 33 '"", null, undefined', |
23 '"", null, function(){}', | 34 '"", null, function(){}', |
24 '"", null, null, null', | 35 '"", null, null, null', |
25 '"", null, null, undefined', | 36 '"", null, null, undefined', |
26 '"", null, null, function(){}', | 37 '"", null, null, function(){}', |
27 ]; | 38 ]; |
28 | 39 |
29 var expectException = [ | 40 var expectException = [ |
30 '', | 41 '', |
31 'throwOnToStringObject', | 42 'throwOnToStringObject', |
32 '"", throwOnGetLengthObject', | 43 '"", throwOnGetLengthObject', |
33 '"", throwOnGetZeroObject', | 44 '"", throwOnGetZeroObject', |
34 '"", [ throwOnToStringObject ]', | 45 '"", [ throwOnToStringObject ]', |
35 '"", 0', | 46 '"", 0', |
36 '"", ""', | 47 '"", ""', |
37 '"", { }', | 48 '"", { }', |
| 49 '"", { length: 0 }', |
| 50 '"", { length: 1, 0: "arg0" }', |
38 '"", null, 0', | 51 '"", null, 0', |
39 '"", null, ""', | 52 '"", null, ""', |
40 '"", null, { }', | 53 '"", null, { }', |
41 '"", null, null, 0', | 54 '"", null, null, 0', |
42 '"", null, null, ""', | 55 '"", null, null, ""', |
43 '"", null, null, { }', | 56 '"", null, null, { }', |
44 ]; | 57 ]; |
45 | 58 |
46 function tryExecuteSql(transaction, parameterList) | 59 function tryExecuteSql(transaction, parameterList) |
47 { | 60 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 if (window.testRunner) | 92 if (window.testRunner) |
80 testRunner.notifyDone(); | 93 testRunner.notifyDone(); |
81 } | 94 } |
82 | 95 |
83 function runTest() | 96 function runTest() |
84 { | 97 { |
85 | 98 |
86 var db = openDatabaseWithSuffix("ExecuteSQLArgsTest", "1.0", "Test of handli
ng of the arguments to SQLTransaction.executeSql", 1); | 99 var db = openDatabaseWithSuffix("ExecuteSQLArgsTest", "1.0", "Test of handli
ng of the arguments to SQLTransaction.executeSql", 1); |
87 db.transaction(runTransactionTests); | 100 db.transaction(runTransactionTests); |
88 } | 101 } |
OLD | NEW |