OLD | NEW |
1 description("createAttirbuteNS tests adapted from createElementNS tests attached
to webkit bug 16833"); | 1 description("createAttirbuteNS tests adapted from createElementNS tests attached
to webkit bug 16833"); |
2 | 2 |
3 function assert(c, m) | 3 function assert(c, m) |
4 { | 4 { |
5 if (!c) | 5 if (!c) |
6 testFailed(m); | 6 testFailed(m); |
7 else | 7 else |
8 testPassed(m); | 8 testPassed(m); |
9 } | 9 } |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 testFailed(m); | 31 testFailed(m); |
32 } else { | 32 } else { |
33 m += "; threw " + exception.toString(); | 33 m += "; threw " + exception.toString(); |
34 testPassed(m); | 34 testPassed(m); |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 var allNSTests = [ | 38 var allNSTests = [ |
39 { args: [undefined, undefined] }, | 39 { args: [undefined, undefined] }, |
40 { args: [null, undefined] }, | 40 { args: [null, undefined] }, |
41 { args: [undefined, null], code: 5 }, | 41 { args: [undefined, null] }, |
42 { args: [null, null], code: 5 }, | 42 { args: [null, null] }, |
43 { args: [null, ""], code: 5 }, | 43 { args: [null, ""], code: 5 }, |
44 { args: ["", null], code: 5 }, | 44 { args: ["", null] }, |
45 { args: ["", ""], code: 5 }, | 45 { args: ["", ""], code: 5 }, |
46 { args: [null, "<div>"], code: 5 }, | 46 { args: [null, "<div>"], code: 5 }, |
47 { args: [null, "0div"], code: 5 }, | 47 { args: [null, "0div"], code: 5 }, |
48 { args: [null, "di v"], code: 5 }, | 48 { args: [null, "di v"], code: 5 }, |
49 { args: [null, "di<v"], code: 5 }, | 49 { args: [null, "di<v"], code: 5 }, |
50 { args: [null, "-div"], code: 5 }, | 50 { args: [null, "-div"], code: 5 }, |
51 { args: [null, ".div"], code: 5 }, | 51 { args: [null, ".div"], code: 5 }, |
52 { args: ["http://example.com/", "<div>"], code: 5 }, | 52 { args: ["http://example.com/", "<div>"], code: 5 }, |
53 { args: ["http://example.com/", "0div"], code: 5 }, | 53 { args: ["http://example.com/", "0div"], code: 5 }, |
54 { args: ["http://example.com/", "di<v"], code: 5 }, | 54 { args: ["http://example.com/", "di<v"], code: 5 }, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 try { | 118 try { |
119 createFunction.apply(doc, test.args); | 119 createFunction.apply(doc, test.args); |
120 assert(!("code" in test), msg); | 120 assert(!("code" in test), msg); |
121 } catch (e) { | 121 } catch (e) { |
122 assertExceptionCode(e, test.code || "expected no exception", msg); | 122 assertExceptionCode(e, test.code || "expected no exception", msg); |
123 } | 123 } |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 runNSTests(); | 127 runNSTests(); |
OLD | NEW |